Skip to content

Nightly v5 integration tests #189

Nightly v5 integration tests

Nightly v5 integration tests #189

name: Nightly v5 integration tests
on:
schedule:
- cron: "15 9 * * *"
workflow_dispatch:
inputs:
send-slack-message:
description: 'whether to send a message to #daq-release-notifications on failure'
default: 'no'
jobs:
make_nightly_tag:
name: create nightly tag
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.create_nightly_tag.outputs.nightly_tag }}
defaults:
run:
shell: bash
steps:
- id: create_nightly_tag
run: |
date_tag=$(date +%y%m%d)
echo "nightly_tag=NFD_DEV_${date_tag}_A9" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
exit 1
integration_tests:
name: integration_tests
runs-on: daq
timeout-minutes: 30
needs: make_nightly_tag
strategy:
fail-fast: false
matrix:
test_name: ["listrev",
"minimal_system_quick",
"3ru_1df_multirun",
"example_system",
"long_window_readout",
"small_footprint_quick",
"tpstream_writing"]
defaults:
run:
shell: bash
steps:
- name: setup release and run tests
env:
NIGHTLY_TAG: ${{needs.make_nightly_tag.outputs.tag}}
run: |
DET=fd
mkdir -p $GITHUB_WORKSPACE/integration_tests_$NIGHTLY_TAG
cd $GITHUB_WORKSPACE/integration_tests_$NIGHTLY_TAG
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest_v5
[[ -e /cvmfs/dunedaq-development.opensciencegrid.org/nightly/$NIGHTLY_TAG/daq_app_rte.sh ]]
dbt-setup-release -n $NIGHTLY_TAG
export DBT_INSTALL_DIR=/cvmfs/dunedaq-development.opensciencegrid.org/nightly/$NIGHTLY_TAG
TEST_PATH=""
if [[ "${{ matrix.test_name }}" == "listrev" ]]; then
TEST_PATH=$LISTREV_SHARE/integtest
else
TEST_PATH=$DAQSYSTEMTEST_SHARE/integtest
export DUNEDAQ_DB_PATH=$DAQSYSTEMTEST_SHARE:$DUNEDAQ_DB_PATH
fi
pytest -v -s --junit-xml=${{ matrix.test_name }}_test_results.xml \
$TEST_PATH/${{ matrix.test_name }}_test.py
#$LISTREV_SHARE/integtest/listrev_test.py
parse_results:
runs-on: daq
if: always()
needs: [make_nightly_tag, integration_tests]
steps:
- name: Surface failing tests
#uses: pmeier/pytest-results-action@8104ed7b3d3ba4bb0d550e406fc26aa756630fcc
uses: andrewmogan/pytest-results-action@1158583ebac3346e36d76969902bc1fa7b925270
env:
NIGHTLY_TAG: ${{ needs.make_nightly_tag.outputs.tag}}
with:
path: ${{ github.workspace }}/integration_tests_${{ env.NIGHTLY_TAG }}/*_test_results.xml
summary: true
display-options: fEX
fail-on-empty: true
cleanup_xml_files:
runs-on: daq
if: always()
needs: [make_nightly_tag, parse_results]
steps:
- name: Remove xml files
env:
NIGHTLY_TAG: ${{ needs.make_nightly_tag.outputs.tag }}
run: |
rm -rf ${{ github.workspace }}/integration_tests_${{ env.NIGHTLY_TAG }}
# Integration tests can sometimes collide with stale processes, leading to timeout
cleanup_stale_gunicorn_processes:
runs-on: daq
if: always()
needs: integration_tests
steps:
- name: Run cleanup script
run: |
/home/nfs/dunedaq/kill_stale_gunicorn_processes.sh
send_slack_message:
runs-on: daq
name: send slack message
needs: [make_nightly_tag, integration_tests]
if: always()
steps:
- name: Set payload path for failure message
if: failure()
run: echo "PAYLOAD_PATH=workflow-failure-message.json" >> $GITHUB_ENV
- name: Set payload path for success message
if: success() && (github.event_name == 'workflow_dispatch' && github.event.inputs.send-slack-message == 'yes')
run: echo "PAYLOAD_PATH=workflow-success-message.json" >> $GITHUB_ENV
- name: Send custom JSON data to Slack workflow
id: slack
uses: slackapi/slack-github-action@v1.27.0
if: (failure() && github.event_name != 'workflow_dispatch') || (success() && github.event_name == 'workflow_dispatch' && github.event.inputs.send-slack-message == 'yes')
with:
# For posting a rich message using Block Kit
payload-file-path: ${{ steps.payload.outputs.PAYLOAD_PATH }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TEST_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK