-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore(gh-workflows): add regression tests to release job #1665
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
aa4c2fa
chore(gh-workflows): add regression tests to release job
kostasrim 8369e3e
WIP
kostasrim d827047
fix: migrate reusable workflow as action
kostasrim 3aa956e
fix: regression test action
kostasrim 41e17e5
fix: broken action
kostasrim d31a423
fix: prefix token to properly use it
kostasrim a0decab
fix: add missing composite
kostasrim d4375a7
fix: use expression properly
kostasrim 3a7dba8
fix: update release workflow
kostasrim 64c086f
fix: action check && release
kostasrim f41aeec
to be dropped
kostasrim 0173dc0
WIP
kostasrim be56c36
try regression on release
kostasrim dce6c0a
add trigger
kostasrim cd2dd22
try
kostasrim 0a0f223
try proper tagging
kostasrim 3d983c6
add explicit tag
kostasrim 928be49
add pip install
kostasrim 29e9f70
call action properly
kostasrim 246576b
properly name dfly executable on release
kostasrim 23a0b57
try to run composite action in docker arm
kostasrim db9754b
revert regression tests for docker arm release
kostasrim 65f5cae
revert CI to original state
kostasrim cdebaf2
remove extra spaces
kostasrim f256e6c
add parameter for build folder name in regression action
kostasrim 6be689a
Merge branch 'main' into update_release_workflow
kostasrim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Regression Tests | ||
description: "Run regression tests" | ||
|
||
inputs: | ||
dfly-executable: | ||
required: true | ||
type: string | ||
gspace-secret: | ||
required: true | ||
type: string | ||
run-only-on-ubuntu-latest: | ||
# 'true' or 'false' cause boolean | ||
# is not supported in composite actions | ||
required: true | ||
type: string | ||
build-folder-name: | ||
required: true | ||
type: string | ||
|
||
|
||
runs: | ||
using: "composite" | ||
# bring back timeouts once composite actions start supporting them | ||
# timeout-minutes: 20 | ||
steps: | ||
- name: Run PyTests | ||
shell: bash | ||
run: | | ||
ls -l ${GITHUB_WORKSPACE}/ | ||
cd ${GITHUB_WORKSPACE}/tests | ||
echo "Current commit is ${{github.sha}}" | ||
pip install -r dragonfly/requirements.txt | ||
# used by PyTests | ||
export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}" | ||
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 # to crash on errors | ||
|
||
pytest --json-report --json-report-file=report.json -svr dragonfly --ignore=dragonfly/replication_test.py | ||
|
||
|
||
|
||
- name: Run PyTests replication test | ||
if: ${{ inputs.run-only-on-ubuntu-latest == 'false' || matrix.runner == 'ubuntu-latest' }} | ||
shell: bash | ||
run: | | ||
echo "Running PyTests replication test with flag: ${{ inputs.run-only-on-ubuntu-latest }}" | ||
cd ${GITHUB_WORKSPACE}/tests | ||
# used by PyTests | ||
export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}" | ||
|
||
pytest --json-report --json-report-file=rep1_report.json -sv dragonfly/replication_test.py --df alsologtostderr --df enable_multi_shard_sync=true | ||
pytest --json-report --json-report-file=rep2_report.json -sv dragonfly/replication_test.py --df alsologtostderr --df enable_multi_shard_sync=false | ||
|
||
|
||
|
||
- name: Send notification on failure | ||
if: failure() | ||
shell: bash | ||
run: | | ||
get_failed_tests() { | ||
local report_file=$1 | ||
echo $(jq -r '.tests[] | select(.outcome == "failed") | .nodeid' "$report_file") | ||
} | ||
cd ${GITHUB_WORKSPACE}/tests | ||
failed_tests="" | ||
# The order in of if is important, and expected to be the oposite order of the pytest run. | ||
# As github runner will not run the next step if the pytest failed, we start from the last | ||
# report file and if exist we get the failed test from the pytest run, if there are any. | ||
if [ -f rep2_report.json ]; then | ||
failed_tests=$(get_failed_tests rep2_report.json) | ||
elif [ -f rep1_report.json ]; then | ||
failed_tests=$(get_failed_tests rep1_report.json) | ||
elif [ -f report.json ]; then | ||
failed_tests=$(get_failed_tests report.json) | ||
fi | ||
|
||
job_link="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | ||
message="Regression tests failed.\\n The commit is: ${{github.sha}}.\\n $failed_tests \\n Job Link: ${job_link}\\n" | ||
|
||
curl -s \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' \ | ||
'${{ inputs.gspace-secret }}' \ | ||
-d '{"text": "'"${message}"'"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we now have several "apt install" calls in our actions. Let's eliminate them by adding all these packages to
ghcr.io/romange/ubuntu-dev
. Feel free to send a PR to https://github.com/romange/container-foundryThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already opened a PR.
run-on-aarch
action. I could simply not find a way to do this properly. Moreover, we only have x86 runners so running on a pure aarch machine was a big no and therefore we require QEMU. But as I looked on your repo, it seems that you already using QEMU which means that I could reuse your images instead ofrun-on-aarch
and therefore I would be able to run that action as separate step (because the OG issue, that I can't run an action in the context of another action, that is, therun-on-aarch
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/dragonflydb/dragonfly/pull/1706/files
plz release a new package to your repo such that I can remove the
apt install's