Show tests to add to testfile in CircleCI

Signed-off-by: Alex Chen <minecnly@gmail.com>
This commit is contained in:
Cnly 2019-06-04 04:42:09 +08:00
parent 6ce865c632
commit 896ddd69d6
2 changed files with 22 additions and 2 deletions

View file

@ -8,10 +8,10 @@ jobs:
- checkout
# Set up dendrite
- run:
- run:
name: Build Dendrite
command: ./build.sh
- run:
- run:
name: Copy dummy keys to root
command: |
mv .circleci/matrix_key.pem .
@ -19,6 +19,9 @@ jobs:
- run:
name: Run sytest with whitelisted tests
command: /dendrite_sytest.sh
- run:
name: Check for new tests to be added to testfile
command: /show-expected-fail-tests.sh /logs/results.tap
- store_artifacts:
path: /logs

17
show-expected-fail-tests.sh Executable file
View file

@ -0,0 +1,17 @@
#! /bin/bash
results_file=$1
tests_to_add=$(grep ' # TODO passed but expected fail' ${results_file} | sed -E 's/^ok [0-9]+ (\(expected fail\) )?//' | sed -E 's/( \([0-9]+ subtests\))? # TODO passed but expected fail$//')
fail_build=0
while read -r test_id; do
grep "${test_id}" testfile > /dev/null 2>&1
if [ "$?" != "0" ]; then
echo "ERROR: Passed test not present in testfile: ${test_id}"
fail_build=1
else
echo "WARN: Test in testfile still marked as expected fail: ${test_id}"
fi
done <<< "${tests_to_add}"
exit ${fail_build}