Skip to content

Commit

Permalink
now working ci test but test teeing sequencer out
Browse files Browse the repository at this point in the history
  • Loading branch information
noursaidi committed Nov 9, 2022
1 parent 5adbb9d commit f4328d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ jobs:
run: |
bin/setup_base
bin/clone_model
- name: sequence solo tests
env:
GCP_TARGET_PROJECT: ${{ secrets.GCP_TARGET_PROJECT }}
SEQUENCER_OPTS: ${{ secrets.SEQUENCER_OPTS }}
if: "${{ env.GCP_TARGET_PROJECT != '' }}"
run: |
bin/test_itemized $GCP_TARGET_PROJECT
more /tmp/test_itemized.out
diff -u /tmp/test_itemized.out etc/test_itemized.out
- name: telemetry validator
env:
GCP_TARGET_PROJECT: ${{ secrets.GCP_TARGET_PROJECT }}
Expand All @@ -136,6 +127,15 @@ jobs:
ls -1 sites/udmi_site_model/out/devices/AHU-1/tests/ | xargs -I% diff -u \
sites/udmi_site_model/out/devices/AHU-1/tests/%/sequence.md \
validator/sequences/%/sequence.md
- name: itemized sequencer tests
env:
GCP_TARGET_PROJECT: ${{ secrets.GCP_TARGET_PROJECT }}
SEQUENCER_OPTS: ${{ secrets.SEQUENCER_OPTS }}
if: "${{ env.GCP_TARGET_PROJECT != '' }}"
run: |
bin/test_itemized $GCP_TARGET_PROJECT
more /tmp/test_itemized.out
diff -u /tmp/test_itemized.out etc/test_itemized.out
- name: output logs
if: ${{ always() }}
run: |
Expand Down
15 changes: 5 additions & 10 deletions bin/test_itemized
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e

PROJECT_ID=$1
shift 1
Expand All @@ -8,10 +8,10 @@ REGEX="^TEST ([a-z_]+)([A-Za-z ]+)?(RESULT .*)?$"
SITE_PATH=sites/udmi_site_model
DEVICE_ID=AHU-1

RESULTS_OUT=/tmp/test_itemized.out
PUBBER_OUT=/tmp/pubber.log
SEQUENCER_OUT=/tmp/sequencer.log
TEST_LIST=etc/sest_itemized.out.txt
RESULTS_OUT=/tmp/test_itemized.out
GOLDEN_FILE=etc/test_itemized.out

rm -f $RESULTS_OUT $SEQUENCER_OUT $PUBBER_OUT
touch $RESULTS_OUT $SEQUENCER_OUT $PUBBER_OUT
Expand All @@ -22,8 +22,6 @@ while read -u 7 action test_name remainder; do
fi
pubber_opts=${remainder/RESULT*/}



echo -n "TEST $test_name $pubber_opts" >> $RESULTS_OUT
echo "TEST $test_name $pubber_opts"

Expand All @@ -43,16 +41,13 @@ while read -u 7 action test_name remainder; do
false
fi

bin/sequencer -v $SITE_PATH $PROJECT_ID $DEVICE_ID $serial_no $test_name > $SEQUENCER_OUT 2>&1
bin/sequencer $SITE_PATH $PROJECT_ID $DEVICE_ID $serial_no $test_name 2>&1 | tee $SEQUENCER_OUT

kill $(ps ax | fgrep pubber | fgrep java | awk '{print $1}')
#more $SEQUENCER_OUT | cat

result=$(grep -E -m 1 "RESULT [a-z]+ $test_name " $SEQUENCER_OUT)
echo ${result/*sequencer RESULT/RESULT} >> $RESULTS_OUT

sleep 2

done 7< etc/test_itemized.out

cat $RESULTS_OUT
done 7< $GOLDEN_FILE

0 comments on commit f4328d1

Please sign in to comment.