Skip to content

Commit

Permalink
Disable FIPS tests by default in master
Browse files Browse the repository at this point in the history
  • Loading branch information
dkirov-dd committed Dec 18, 2024
1 parent f98c4d1 commit 6ceb4d2
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions .github/workflows/test-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ on:
required: false
type: string
default: "{}"
run-fips:
description: "If false, FIPS tests will be skipped."
required: false
type: boolean
default: false

defaults:
run:
Expand Down Expand Up @@ -142,6 +147,14 @@ jobs:
done
echo "E2E_ENV_VARS=$E2E_ENV_VARS" >> $GITHUB_ENV
- name: Dynamically adjust pytest-args
run: |
PYTEST_ARGS="${{ inputs.pytest-args }}"
if [ "${{ inputs.run-fips }}" = "false" ]; then
PYTEST_ARGS+=" -k 'not fips'"
fi
echo "PYTEST_ARGS=$PYTEST_ARGS" >> $GITHUB_ENV
- name: Set up Windows
if: runner.os == 'Windows'
run: |-
Expand Down Expand Up @@ -243,7 +256,7 @@ jobs:
run: |
if [ '${{ inputs.pytest-args }}' = '-m flaky' ]; then
set +e # Disable immediate exit
ddev test --cov --junit ${{ inputs.target }} -- ${{ inputs.pytest-args }}
ddev test --cov --junit ${{ inputs.target }} -- ${{ env.PYTEST_ARGS }}
exit_code=$?
if [ $exit_code -eq 5 ]; then
# Flaky test count can be zero, this is done to avoid pipeline failure
Expand All @@ -253,15 +266,15 @@ jobs:
exit $exit_code
fi
else
ddev test --cov --junit ${{ inputs.target }} ${{ inputs.pytest-args != '' && format('-- {0}', inputs.pytest-args) || '' }}
ddev test --cov --junit ${{ inputs.target }} ${{ env.PYTEST_ARGS != '' && format('-- {0} -k "not fips"', env.PYTEST_ARGS) || '-k "not fips"' }}
fi
- name: Run Unit & Integration tests with minimum version of base package
if: inputs.standard && inputs.minimum-base-package
run: |
if [ '${{ inputs.pytest-args }}' = '-m flaky' ]; then
set +e # Disable immediate exit
ddev test --compat --recreate --junit ${{ inputs.target }} -- ${{ inputs.pytest-args }}
ddev test --compat --recreate --junit ${{ inputs.target }} -- ${{ env.PYTEST_ARGS }} -k "not fips"
exit_code=$?
if [ $exit_code -eq 5 ]; then
# Flaky test count can be zero, this is done to avoid pipeline failure
Expand All @@ -271,7 +284,7 @@ jobs:
exit $exit_code
fi
else
ddev test --compat --recreate --junit ${{ inputs.target }} ${{ inputs.pytest-args != '' && format('-- {0}', inputs.pytest-args) || '' }}
ddev test --compat --recreate --junit ${{ inputs.target }} ${{ env.PYTEST_ARGS != '' && format('-- {0} -k "not fips"', env.PYTEST_ARGS) || '-k "not fips"' }}
fi
- name: Run E2E tests with latest base package
Expand All @@ -288,7 +301,7 @@ jobs:
# 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 ${{ inputs.pytest-args }}
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
Expand All @@ -299,7 +312,7 @@ jobs:
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 ${{ inputs.pytest-args }}
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
Expand All @@ -309,7 +322,7 @@ jobs:
exit $exit_code
fi
else
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }} ${{ inputs.pytest-args != '' && format('-- all {0}', inputs.pytest-args) || '' }}
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }} ${{ env.PYTEST_ARGS != '' && format('-- all {0}', env.PYTEST_ARGS) || '' }}
fi
- name: Run E2E tests
Expand All @@ -326,7 +339,7 @@ jobs:
# by default
if [ '${{ inputs.pytest-args }}' = '-m flaky' ]; then
set +e # Disable immediate exit
ddev env test ${{ env.E2E_ENV_VARS }} --new-env --junit ${{ inputs.target }} -- all ${{ inputs.pytest-args }}
ddev env test ${{ env.E2E_ENV_VARS }} --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
Expand All @@ -337,7 +350,7 @@ jobs:
fi
elif [ '${{ inputs.pytest-args }}' = '-m "not flaky"' ]; then
set +e # Disable immediate exit
ddev env test ${{ env.E2E_ENV_VARS }} --new-env --junit ${{ inputs.target }} -- all ${{ inputs.pytest-args }}
ddev env test ${{ env.E2E_ENV_VARS }} --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
Expand All @@ -347,7 +360,7 @@ jobs:
exit $exit_code
fi
else
ddev env test ${{ env.E2E_ENV_VARS }} --new-env --junit ${{ inputs.target }} ${{ inputs.pytest-args != '' && format('-- all {0}', inputs.pytest-args) || '' }}
ddev env test ${{ env.E2E_ENV_VARS }} --new-env --junit ${{ inputs.target }} ${{ env.PYTEST_ARGS != '' && format('-- all {0}', env.PYTEST_ARGS) || '' }}
fi
- name: Run benchmarks
Expand All @@ -373,7 +386,7 @@ jobs:
# 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 }}:latest -- all ${{ inputs.pytest-args }}
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }}:latest -- 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
Expand All @@ -384,7 +397,7 @@ jobs:
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 }}:latest -- all ${{ inputs.pytest-args }}
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }}:latest -- 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
Expand All @@ -394,7 +407,7 @@ jobs:
exit $exit_code
fi
else
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }}:latest ${{ inputs.pytest-args != '' && format('-- all {0}', inputs.pytest-args) || '' }}
ddev env test ${{ env.E2E_ENV_VARS }} --base --new-env --junit ${{ inputs.target }}:latest ${{ env.PYTEST_ARGS != '' && format('-- all {0}', env.PYTEST_ARGS) || '' }}
fi
- name: View trace log
Expand Down

0 comments on commit 6ceb4d2

Please sign in to comment.