Skip to content

Commit

Permalink
Revert changes to trickops test yml file from Sept 2023 to fix tricko…
Browse files Browse the repository at this point in the history
…ps unit tests (#1681)

* TrickOps: Revert changes to trickops test yml file from Sept 2023

* trick_sims.yml was "accidentally changed" to remove unstable sims
  in Sept 2023, breaking the TrickOps unit tests. This reverts that change.
* Adjust new hashlib md5 comparison approach to work on systems where
  'usedforsecurity' isn't supported

* Move TrickOps Unit tests back into pull requests

* Adjust TrickOps actions artifacts to use v3.0.0

Per suggestion on workaround as described here:
  actions/upload-artifact#478

---------

Co-authored-by: Dan Jordan <[email protected]>
  • Loading branch information
ddj116 and Dan Jordan authored Apr 1, 2024
1 parent c4e60d9 commit c6e44c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/trickops.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: TrickOps
# This workflow is triggered on pushes to the repository.
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
on: [pull_request]

defaults:
run:
Expand Down Expand Up @@ -34,7 +31,7 @@ jobs:
source ../.venv/bin/activate
export PATH="/tmp/koviz-master/bin:${PATH}"
./run_tests.py
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3.0.0
if: ${{ always() }}
with:
name: doctests
Expand Down Expand Up @@ -66,7 +63,7 @@ jobs:
source ../.venv/bin/activate
export PATH="/tmp/koviz-master/bin:${PATH}"
./run_tests.py
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v3.0.0
if: ${{ always() }}
with:
name: doctests
Expand Down
7 changes: 5 additions & 2 deletions share/trick/trickops/TrickWorkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1284,8 +1284,11 @@ def compare(self):
self.status = Job.Status.FAILED
if self.missing:
return self.status
if (hashlib.md5(open(self.test_data,'rb').read(), usedforsecurity=False).hexdigest() !=
hashlib.md5(open(self.baseline_data,'rb').read(), usedforsecurity=False).hexdigest()):
td = hashlib.new('md5', usedforsecurity=False)
bd = hashlib.new('md5', usedforsecurity=False)
td.update(open(self.test_data,'rb').read())
bd.update(open(self.baseline_data,'rb').read())
if (td.hexdigest() != bd.hexdigest()):
self.status = Job.Status.FAILED
else:
self.status = Job.Status.SUCCESS
Expand Down
16 changes: 8 additions & 8 deletions share/trick/trickops/tests/trick_sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ SIM_test_templates:
- unit_test
runs:
RUN_test/unit_test.py:
# SIM_test_varserv:
# path: test/SIM_test_varserv
# labels:
# - unit_test
# runs:
# RUN_test/unit_test.py:
SIM_test_varserv:
path: test/SIM_test_varserv
labels:
- unit_test
runs:
RUN_test/unit_test.py:
SIM_threads:
path: test/SIM_threads
labels:
Expand Down Expand Up @@ -189,8 +189,8 @@ SIM_ball_L2:
runs:
SIM_ball_L3:
path: trick_sims/Ball/SIM_ball_L3
# SIM_amoeba:
# path: trick_sims/Cannon/SIM_amoeba
SIM_amoeba:
path: trick_sims/Cannon/SIM_amoeba
SIM_cannon_aero:
path: trick_sims/Cannon/SIM_cannon_aero
SIM_cannon_analytic:
Expand Down

0 comments on commit c6e44c6

Please sign in to comment.