我在 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
问题是管道不会产生相同的结果。在第二个管道中,我的命令(例如 yarn test)会在几秒钟内产生空结果。首先(在推送时执行)测试运行良好。
这是第一个管道的输出:
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 命令在第一个和第二个管道中返回相同的内容。而且问题不仅在于开玩笑,其他事情(如构建、lint 等)在第二个管道中产生相同的零结果。
会发生什么以及如何修复它以使命令在链式管道中工作?