forked from CircleCI-Public/orb-tools-orb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.yml
38 lines (36 loc) · 1.46 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
description: >
Pack a test configuration and execute a test job locally.
parameters:
test-verification:
description: define additional post-test-execution checks to verify that the test succeeded
type: steps
default: []
test-config:
description: the path to the test case config that refers to the orb jobs to be tested
type: string
expect-fail:
description: enable if this test case is expected to fail, otherwise let it disabled to the default
type: boolean
default: false
steps:
- run:
name: copy test source of << parameters.test-config >>
command: |
source /usr/local/bin/envload
cp << parameters.test-config >> ./.orbspace/test/config.yml
- orb-tools/pack:
source: ./.orbspace/test
destination: ./.orbspace/test-case.src.yml
- run:
name: compile test config << parameters.test-config >>
command: circleci config process ./.orbspace/test-case.src.yml > ./.orbspace/test-case.yml
- 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'"
# 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 >>