Skip to content

Commit

Permalink
Update test-fips.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirov-dd committed Dec 20, 2024
1 parent 8cec105 commit 1f4c5dc
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions .github/workflows/test-fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
description: "Target to test"
required: false
type: string
pull_request:
push:
paths:
- datadog_checks_base/datadog_checks/**
schedule:
Expand Down Expand Up @@ -47,7 +47,6 @@ jobs:

- name: Set environment variables with sanitized paths
run: |
# We want to replace leading dots as they will make directories hidden, which will cause them to be ignored by upload-artifact and EnricoMi/publish-unit-test-result-action
JOB_NAME="FIPS-${{ github.run_id }}"
echo "TEST_RESULTS_DIR=$TEST_RESULTS_BASE_DIR/$JOB_NAME" >> $GITHUB_ENV
Expand Down Expand Up @@ -141,37 +140,13 @@ jobs:
# ddev will interpret '-m' as an environment to run the e2e test on and fails
# This is not required when no pytest args are provided and it will run all environments
# by default
if [ '${{ inputs.pytest-args }}' = '-m flaky' ]; then
set +e # Disable immediate exit
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }} -- all ${{ env.PYTEST_ARGS }}
exit_code=$?
if [ $exit_code -eq 5 ]; then
# Flaky test count can be zero, this is done to avoid pipeline failure
echo "No tests were collected."
exit 0
else
exit $exit_code
fi
elif [ '${{ inputs.pytest-args }}' = '-m "not flaky"' ]; then
set +e # Disable immediate exit
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }} -- all ${{ env.PYTEST_ARGS }}
exit_code=$?
if [ $exit_code -eq 5 ]; then
# Flaky test count can be zero, this is done to avoid pipeline failure
echo "No tests were collected."
exit 0
else
exit $exit_code
fi
else
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }} ${{ env.PYTEST_ARGS != '' && format('-- all {0}', env.PYTEST_ARGS) || '' }}
fi
ddev env test -e GOFIPS=1 --base --new-env --junit ${{ inputs.target }} -- all -k fips
- name: Run E2E tests
env:
DD_API_KEY: "${{ secrets.DD_API_KEY }}"
run: |
ddev env test -e GOFIPS=1 --new-env --junit ${{ inputs.target || 'tls' }} -- '-k fips'
ddev env test -e GOFIPS=1 --new-env --junit ${{ inputs.target || 'tls' }} -- all -k fips
- name: Run benchmarks
if: inputs.benchmark
Expand Down

0 comments on commit 1f4c5dc

Please sign in to comment.