Skip to content

Nightly v4 integration tests #148

Nightly v4 integration tests

Nightly v4 integration tests #148

name: Nightly v4 integration tests
on:
schedule:
- cron: "0 9 * * 0"
workflow_dispatch:
inputs:
send-slack-message:
description: 'whether to send a message to #daq-release-notifications on completion'
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)
if [ "$(date +%a)" != "Sun" ]; then
date_tag=$(date +%y%m%d -d 'last sunday');
fi
echo "nightly_tag=NFD_PROD4_${date_tag}_A9" >> "$GITHUB_OUTPUT"
cat "$GITHUB_OUTPUT"
integration_tests:
name: integration_tests
runs-on: daq
timeout-minutes: 30
needs: make_nightly_tag
strategy:
fail-fast: false
matrix:
test_name: ["minimal_system_quick", "fake_data_producer", "long_window_readout", "small_footprint_quick"]
defaults:
run:
shell: bash
steps:
- name: Checkout daqsystemtest
uses: actions/checkout@v4
with:
repository: DUNE-DAQ/daqsystemtest
path: daqsystemtest
ref: production/v4
- 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
export PATH=$HOME/bin:$PATH
type get-ticket.sh && get-ticket.sh
source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest_v4
dbt-setup-release -n $NIGHTLY_TAG
pytest -v -s --junit-xml=${{ matrix.test_name }}_test_results.xml \
$GITHUB_WORKSPACE/daqsystemtest/integtest/${{ matrix.test_name }}_test.py \
--nanorc-option partition-number 4
cd $GITHUB_WORKSPACE
rm -rf daqsystemtest
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@8b7955ab36427dc46b0f00ea7d4e66a75b7cc943
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:
if: (github.event_name != 'workflow_dispatch' && failure()) || (github.event_name == 'workflow_dispatch' && github.event.inputs.send-slack-message == 'yes')
needs: integration_tests
uses: ./.github/workflows/slack-notification.yml
with:
workflow_success: ${{ needs.integration_tests.result == 'success' }}
secrets:
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }}