docker - “颤振测试”在 docker 映像上失败,但在本地成功
问题描述
我的颤振项目中有几个测试文件,并且在flutter test
本地运行这些文件没有任何错误消息。但是在以以下错误消息结尾的 docker 映像上运行相同的测试:
The following StateError was thrown running a test:
Bad state: No element
我不确定此错误消息的原因是项目本身还是我的问题Dockerfile
FROM ubuntu:16.04
ENV FLUTTER_VERSION="1.22.6"
RUN apt update -y
RUN apt install -y \
git \
wget \
curl \
unzip \
lcov \
lib32stdc++6
ENV FLUTTER_ROOT="/opt/flutter"
RUN git clone --branch $FLUTTER_VERSION --depth=1 https://github.com/flutter/flutter "${FLUTTER_ROOT}"
ENV PATH="${FLUTTER_ROOT}/bin:${PATH}"
RUN flutter config --no-analytics
RUN flutter precache
RUN yes "y" | flutter doctor --android-licenses
RUN flutter doctor -v
ENV PATH $PATH:/flutter/bin/cache/dart-sdk/bin:/flutter/bin
WORKDIR /opt/app
COPY . .
RUN flutter pub get
RUN flutter test
解决方案
推荐阅读
- sql - Asp.net SQL 网络接口,错误:26 - 错误定位服务器/指定的实例
- python - 如何在 KFold 验证中设置样本数?
- spring - 如何在自定义 Spring 注释中引用注释参数?
- javascript - 我想使用transition-group(vue js)为我的列表项(在这种情况下为引号)设置动画
- ios - iOS - 相同小宽度的 UIView 不会在较小的设备上布局
- r - 根据其他列中的值添加具有值的列
- c# - 迭代“任务
>" 在 C# 中? - text-editor - Kate 文本编辑器项目插件问题
- java - 具有低成本任务的顺序和并行计算性能
- firebase - 在 Firebase 函数中验证 reCAPTCHA v3 会导致 CORS 问题