Integration tests ony #8
This file contains 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
name: cosmic-ray-integration | |
on: | |
push: | |
branches: | |
- spike-mutation-testing-cosmic-ray | |
jobs: | |
python-dependencies: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pipenv' | |
- name: Install Pipenv | |
run: pip install pipenv==2023.8.22 | |
- name: Install virtual environment | |
run: | | |
sudo apt-get install libsnappy-dev | |
pipenv install --dev | |
test-cosmic-ray: | |
needs: python-dependencies | |
strategy: | |
matrix: | |
mutation-package-under-test: [ questionnaire, routes ] | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
cache: 'pipenv' | |
- name: Install apt dependencies | |
run: | | |
sudo apt-get install libsnappy-dev libgconf-2-4 jq | |
# Install wkthtmltopdf with patched Qt | |
sudo apt-get install -y xfonts-base xfonts-75dpi | |
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb | |
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb | |
- name: Write app version | |
run: printf "local" > .application-version | |
- name: Install pipenv | |
run: pip install pipenv==2023.8.22 | |
- name: Install virtual environment | |
run: pipenv install --dev | |
- name: Load templates | |
run: make load-design-system-templates | |
- name: Compile translations | |
run: make translate | |
- name: Link env vars | |
run: ln -sf .development.env .env | |
- name: Run cosmic-ray | |
run: | | |
# Manually generate a file to pop the config in | |
cat <<EOF > cosmic-ray.ini | |
[cosmic-ray] | |
module-path = "app/${{ matrix.mutation-package-under-test }}/" | |
timeout = 120.0 | |
excluded-modules = [] | |
test-command = "py.test -n auto tests/integration/${{ matrix.mutation-package-under-test }}" | |
[cosmic-ray.distributor] | |
name = "local" | |
EOF | |
cat cosmic-ray.ini | |
# Initialise cosmic-ray | |
pipenv run cosmic-ray init cosmic-ray.ini cosmic-ray.sqlite | |
# Run it | |
pipenv run cosmic-ray --verbosity=INFO exec cosmic-ray.ini cosmic-ray.sqlite | |
- name: Save HTML output | |
run: | | |
pipenv run cr-html cosmic-ray.sqlite > cosmic-ray-report-${{ matrix.mutation-package-under-test }}.html | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: cosmic-ray-report-${{ matrix.mutation-package-under-test }} | |
path: cosmic-ray-report-${{ matrix.mutation-package-under-test }}.html |