-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·65 lines (48 loc) · 1.89 KB
/
run.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh
test_reporter="$WERCKER_STEP_ROOT/test-reporter"
main() {
display_version
cmd="$WERCKER_TEST_REPORTER_COMMAND"
if [ -z "$WERCKER_TEST_REPORTER_COMMAND" ]; then
cmd="after-build"
fi
args=
if [ -n "$WERCKER_TEST_REPORTER_BATCH_SIZE" ]; then
echo "WERCKER_TEST_REPORTER_BATCH_SIZE=$WERCKER_TEST_REPORTER_BATCH_SIZE"
args="$args --batch-size $WERCKER_TEST_REPORTER_BATCH_SIZE"
fi
if [ -n "$WERCKER_TEST_REPORTER_COVERAGE_ENDPOINT" ]; then
echo "WERCKER_TEST_REPORTER_COVERAGE_ENDPOINT=$WERCKER_TEST_REPORTER_COVERAGE_ENDPOINT"
args="$args --coverage-endpoint $WERCKER_TEST_REPORTER_COVERAGE_ENDPOINT"
fi
if [ -n "$WERCKER_TEST_REPORTER_COVERAGE_INPUT_TYPE" ]; then
echo "WERCKER_TEST_REPORTER_COVERAGE_INPUT_TYPE=$WERCKER_TEST_REPORTER_COVERAGE_INPUT_TYPE"
args="$args -t $WERCKER_TEST_REPORTER_COVERAGE_INPUT_TYPE"
fi
if [ -n "$WERCKER_TEST_REPORTER_EXIT_CODE" ]; then
echo "WERCKER_TEST_REPORTER_EXIT_CODE=$WERCKER_TEST_REPORTER_EXIT_CODE"
args="$args --exit-code $WERCKER_TEST_REPORTER_EXIT_CODE"
fi
if [ -n "$WERCKER_TEST_REPORTER_ID" ]; then
echo "WERCKER_TEST_REPORTER_ID=$WERCKER_TEST_REPORTER_ID"
args="$args --id $WERCKER_TEST_REPORTER_ID"
fi
if [ -n "$WERCKER_TEST_REPORTER_PREFIX" ]; then
echo "WERCKER_TEST_REPORTER_PREFIX=$WERCKER_TEST_REPORTER_PREFIX"
args="$args --prefix $WERCKER_TEST_REPORTER_PREFIX"
fi
if [ -n "$WERCKER_TEST_REPORTER_DEBUG" ]; then
echo "WERCKER_TEST_REPORTER_DEBUG=$WERCKER_TEST_REPORTER_DEBUG"
args="$args --debug $WERCKER_TEST_REPORTER_DEBUG"
fi
raw_args=$WERCKER_TEST_REPORTER_ARGUMENTS
echo "Running codeclimate test-reporter command"
echo "$(basename "$test_reporter") $cmd $args $raw_args"
eval "$test_reporter" "$cmd" "$args" "$raw_args"
}
display_version() {
echo "Running codeclimate test-reporter version:"
"$test_reporter" --version
echo ""
}
main