Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken build and sort etc/sequence.out #612

Merged
merged 4 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
- name: bin/run_tests registrar_tests
if: ${{ always() }}
run: bin/run_tests registrar_tests
- name: bin/run_tests util_tests
if: ${{ always() }}
run: bin/run_tests util_tests

spelling:
name: Docs Spelling Checks
Expand Down
10 changes: 10 additions & 0 deletions bin/fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash -e
#
# Convenience script to simply output a message and then fail. Useful for testing in the form of:
#
# do_test_stuff || bin/fail the testing script failed
#

echo fail because $@

false
4 changes: 2 additions & 2 deletions bin/run_tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ $0 [step]
where [step] is one of:
install_dependencies
code_tests
util_tests
schema_tests
trace_tests
registrar_tests
util_tests
all_tests
EOF
false
Expand Down Expand Up @@ -46,10 +46,10 @@ case "$1" in
all_tests)
bin/run_tests install_dependencies
bin/run_tests code_tests
bin/run_tests util_tests
bin/run_tests schema_tests
bin/run_tests trace_tests
bin/run_tests registrar_tests
bin/run_tests util_tests
;;
*)
usage
Expand Down
16 changes: 10 additions & 6 deletions bin/test_sequencer
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
ROOT_DIR=$(dirname $0)/..
cd $ROOT_DIR

# Fix sort order difference on different platforms.
export LC_ALL=C

if [[ $# -lt 1 ]]; then
echo Usage: $0 PROJECT_ID [tests...]
false
Expand All @@ -27,7 +30,7 @@ device_id=AHU-1
device_out_base=$site_path/out/devices/$device_id
test_out_base=$device_out_base/tests
rm -rf $test_out_base
mkdir -p $test_out_base
mkdir -p $test_out_base out/

serial_no=sequencer-$RANDOM
echo Using pubber with serial $serial_no
Expand Down Expand Up @@ -68,8 +71,8 @@ fi
bin/sequencer -a $SEQUENCER_OPTS $site_path $project_id $device_id $serial_no $targets 2>&1 | tee sequencer.out
echo Completed execution of sequencer test run.

sed -i -e 's/.*sequence RESULT/RESULT/' /tmp/sequencer.out
echo Copied output to /tmp/sequencer.out for later examination.
sed -e 's/.*sequence RESULT/RESULT/' /tmp/sequencer.out | sort > out/sequencer.out
echo Copied output to out/sequencer.out for later examination.

pids=`ps ax | fgrep pubber | fgrep java | awk '{print $1}'`
if [[ -n $pids ]]; then
Expand All @@ -84,11 +87,12 @@ generated=docs/specs/sequences/generated.md
cp $generated /tmp/ # Save for test/comparison later
bin/gencode_seq

echo Comparing diff /tmp/sequencer.out etc/sequencer.out
diff -u /tmp/sequencer.out etc/sequencer.out
echo Comparing diff out/sequencer.out etc/sequencer.out
md5sum out/sequencer.out etc/sequencer.out
diff -u out/sequencer.out etc/sequencer.out

echo Comparing diff /tmp/generated.md docs/specs/sequences/generated.md
diff -u /tmp/generated.md docs/specs/sequences/generated.md || (
diff -u out/generated.md docs/specs/sequences/generated.md || (
echo Run bin/gencode_seq to regenerate output, if necessary.
false
)
Expand Down
3 changes: 1 addition & 2 deletions bin/test_sites
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ echo Testing simple mock sequencer...
bin/sequencer tests/downgrade.site/ -- DWN-2 54321 system_mode_restart

RESULTLOG=tests/downgrade.site/out/devices/DWN-2/RESULT.log
echo Checking expected output from $RESULTLOG
fgrep "RESULT fail system.mode system_mode_restart STABLE 5 null" $RESULTLOG
fgrep "RESULT fail system.mode system_mode_restart ALPHA 5 null" $RESULTLOG || bin/fail unexpected output from $RESULTLOG

echo
echo Done with site tests
2 changes: 1 addition & 1 deletion tests/downgrade.site/registration_summary.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"DWN-2" : "devices/DWN-2"
},
"Version" : {
"main" : "1.4.0-147-g792ad526"
"main" : "1.4.0-152-g431b58c7"
}
}