我在wercker中有下面的管道。它们对于复制问题的目的是完全相同的。
setup:
steps:
- script:
name: set yarn cache
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install dependencies
code: yarn
- script:
name: ls
code: ls
- script:
name: test-unit
code: yarn test
test-unit:
steps:
- script:
name: set yarn cache
code: yarn config set cache-folder $WERCKER_CACHE_DIR/yarn
- script:
name: install dependencies
code: yarn
- script:
name: ls
code: ls
- script:
name: test-unit
code: yarn test一个被配置为在推送时执行,第二个被配置为在第一个之后执行。


问题是流水线不会产生相同的结果。在第二个管道中,我的命令,例如纱线测试,在几秒钟内产生空的结果。在first (在推送时执行)中,测试运行良好。
下面是第一个管道的输出:
export WERCKER_STEP_ROOT="/pipeline/script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12"
export WERCKER_STEP_ID="script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12"
export WERCKER_STEP_OWNER="wercker"
export WERCKER_STEP_NAME="script"
export WERCKER_REPORT_NUMBERS_FILE="/report/script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12/artifacts"
source "/pipeline/script-3bab60c8-5cfd-4b86-9aa3-733e93e12d12/run.sh" < /dev/null
yarn run v1.7.0
$ jest --verbose
PASS src/components/auth/__tests__/passwordValidation.spec.js
Password Validation Component
✓ renders a vue instance (27ms)
✓ show all errors for invalid password (16ms)
✓ show no errors for valid password (6ms)
PASS src/components/__tests__/payment.spec.js
Payment Form Component
✓ renders a vue instance (44ms)
.....
Test Suites: 7 passed, 7 total
Tests: 24 passed, 24 total
Snapshots: 0 total
Time: 3.261s
Ran all test suites.
Done in 4.49s.下面是有问题的第二个管道的输出:
export WERCKER_STEP_ROOT="/pipeline/script-22826921-2896-40cc-a7f2-d99d0c5377b9"
export WERCKER_STEP_ID="script-22826921-2896-40cc-a7f2-d99d0c5377b9"
export WERCKER_STEP_OWNER="wercker"
export WERCKER_STEP_NAME="script"
export WERCKER_REPORT_NUMBERS_FILE="/report/script-22826921-2896-40cc-a7f2-d99d0c5377b9/numbers.ini"
export WERCKER_REPORT_MESSAGE_FILE="/report/script-22826921-2896-40cc-a7f2-d99d0c5377b9/message.txt"
export WERCKER_REPORT_ARTIFACTS_DIR="/report/script-22826921-2896-40cc-a7f2-d99d0c5377b9/artifacts"
source "/pipeline/script-22826921-2896-40cc-a7f2-d99d0c5377b9/run.sh" < /dev/null
yarn run v1.7.0
$ jest --verbose
Done in 0.08s.所以这是一个问题,我的链式管道中的命令不会产生任何结果。ls命令在第一个和第二个管道中返回相同的内容。问题不仅仅在于jest,像build、lint等其他东西在第二个流水线中也会产生同样的零结果。
发生了什么,如何修复它,使命令在链式管道中工作?
https://stackoverflow.com/questions/51342692
复制相似问题