Skip to content

Commit

Permalink
Catch inconsistent test namespaces in CircleCI.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronweeden committed Dec 6, 2023
1 parent 323b949 commit d3904ba
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ jobs:
REG_TEST_BASE: /../../../../../project/tests/artifacts/regression/current
steps:
- checkout
- run:
name: Make sure test namespaces are consistent
command: >
result=0;
for test_type in {unit,component,integration,regression}; do
for file in $(find tests/$test_type/lib -type f); do
prefix="$(tr '[:lower:]' '[:upper:]' \<<< ${test_type:0:1})${test_type:1}Tests";
expected_namespace="namespace $(dirname $file | sed "s/tests\/$test_type\/lib/$prefix/" | sed 's/\//\\/g');";
actual_namespace="$(grep namespace $file)";
if [[ "$expected_namespace" != "$actual_namespace" ]]; then
echo -e "$file";
echo -e "\tExpected: $expected_namespace";
echo -e "\tActual: $actual_namespace";
result=1;
fi;
done;
done;
exit $result;
- run:
name: Update nodejs
command: |
Expand Down

0 comments on commit d3904ba

Please sign in to comment.