当我尝试跨容器拆分测试用例时,测试用例无法保存,工件也无法保存。
项目结构
pom.xml - //Main module
module1 - pom.xml
module2 - pom.xml
config.yml
version: 2.0
jobs:
test:
parallelism: 2 # parallel containers to split the tests among
docker:
- image: circleci/openjdk:stretch
working_directory: ~/kp
steps:
- checkout
- restore_cache:
keys:
- kp-jobs-dependency-cache-{{ checksum "pom.xml" }} # appends cache key with a hash of pom.xml file
- kp-jobs-dependency-cache- # fallback in case previous cache key is not found
- run: |
mvn -Dtest=$(for file in $(circleci tests glob "./**/src/test/**/*.scala" \
| circleci tests split --split-by=timings); \
do basename $file \
| sed -e "s/.scala/,/"; \
done | tr -d '\r\n') \
-e test
- save_cache:
paths:
- ~/.m2
key: kp-jobs-dependency-cache-{{ checksum "pom.xml" }}
- run:
name: sonar
command: |
mvn -X sonar:sonar -Dlog4j.configuration=./logs sonar:sonar -Dsonar.projectKey=project-sunbird_knowledge-platform-jobs -Dsonar.organization=project-sunbird -Dsonar.host.url=https://sonarcloud.io -Dsonar.exclusions=**/cert-processor/** -Dsonar.scala.coverage.reportPaths=/home/circleci/kp/target/scoverage.xml
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
build:
docker:
- image: circleci/openjdk:stretch
steps:
- checkout
- restore_cache:
keys:
- kp-jobs-dependency-cache-{{ checksum "pom.xml" }} # appends cache key with a hash of pom.xml file
- kp-jobs-dependency-cache- # fallback in case previous cache key is not found
- run: mvn clean install -DskipTests
- save_cache:
paths:
- ~/.m2
key: kp-jobs-dependency-cache-{{ checksum "pom.xml" }}
workflows:
version: 2
build-then-test:
jobs:
- build
- test:
requires:
- build
错误:上传测试结果
Unable to save test results from /tmp/test-results
Error path is not valid /tmp/test-results: error accessing path: /tmp/test-results: lstat /tmp/test-results: no such file or directory
Found no test results, skipping
错误:上传工件错误
Uploading /home/circleci/kp/tmp/test-results to test-results
No artifact files found at /home/circleci/kp/tmp/test-results
我得到的上述错误,任何人都可以帮助解决这个问题吗?
我也在circle ci社区提出了- https://discuss.circleci.com/t/unable-to-save-the-test-result-could-not-able-to-parallelise-the-tests/39619