Skip to content

Commit

Permalink
Use build instead of local execute
Browse files Browse the repository at this point in the history
  • Loading branch information
matfax committed Nov 26, 2018
1 parent c2ca092 commit 0a7be6b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
39 changes: 2 additions & 37 deletions src/commands/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,48 +26,13 @@ steps:
- run:
name: compile test config << parameters.test-config >>
command: circleci config process ./.orbspace/test-case.src.yml > ./.orbspace/test-case.yml
- read-root-elements:
variable: ORB_TEST_WORKFLOWS
template-path: ./.orbspace/test-case.yml
child: workflows
- read-root-elements:
variable: ORB_TEST_JOBS
template-path: ./.orbspace/test-case.yml
child: jobs
- run:
name: create target file for the local execution migration
command: cp ./.orbspace/test-case.yml ./.orbspace/test-case.local.yml
- run:
name: delete entries from the workflows
command: |
source /usr/local/bin/envload
for workflow in $ORB_TEST_WORKFLOWS; do
yq d -v -i ./.orbspace/test-case.local.yml workflows.$wokflow
done
yq d -v -i ./.orbspace/test-case.local.yml jobs
- run:
name: patch jobs into the workflows
command: |
source /usr/local/bin/envload
for workflow in $ORB_TEST_WORKFLOWS; do
yq r -v ./.orbspace/test-case.yml workflows.$workflow.jobs \
| grep -P "^\-" | grep -Po "[a-zA-Z][0-9a-zA-Z_\-\/]*" \
| xargs -n1 -r -i \
sh -vc " \
echo \"Patching $workflow/{}\" && \
yq r -v ./.orbspace/test-case.yml jobs.{}.steps > ./.orbspace/test-steps.tmp && \
yq p -v -i ./.orbspace/test-steps.tmp jobs.$workflow.steps && \
yq m -v -i -a ./.orbspace/test-case.local.yml ./.orbspace/test-steps.tmp \
" || true
done
rm -vf ./.orbspace/test-steps.tmp
- run:
name: run test jobs of << parameters.test-config >> locally
command: |
source /usr/local/bin/envload
for job in $ORB_TEST_JOBS; do
echo "Executing test job '$job'"
echo "WARNING: Tests are not yet implemented - SKIPPING"
# <<# parameters.expect-fail >>! <</ parameters.expect-fail>>circleci local execute --job $job --config ./.orbspace/test-case.local.yml | tee local_build_output.txt /dev/stderr | tail -n 1 | grep "Success"
# TODO Remove true fallback
<<# parameters.expect-fail >>! <</ parameters.expect-fail>>circleci build --job $job --config ./.orbspace/test-case.yml | tee local_build_output.txt /dev/stderr | tail -n 1 | grep "Success" || true
done
- << parameters.test-verification >>
1 change: 1 addition & 0 deletions src/jobs/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ executor:

steps:
- checkout
- setup_remote_docker
- when:
condition: << parameters.patch-parameters >>
steps:
Expand Down
1 change: 1 addition & 0 deletions src/jobs/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ steps:
condition: << parameters.checkout >>
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: << parameters.attach-at >>
- when:
Expand Down

0 comments on commit 0a7be6b

Please sign in to comment.