This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
main not master #4277
Workflow file for this run
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: Integration tests | |
on: push | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
# Use the same Python version used the Dockerfile | |
python-version: [3.9] | |
env: | |
OS: ubuntu-latest | |
PYTHON: ${{ matrix.python-version }} | |
DOCKER_BUILDKIT: 1 | |
HOUSTON_APP_CONTEXT: "codex" | |
steps: | |
# Checkout and env setup | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install libmagic on Ubuntu | |
run: | | |
sudo apt install libmagic1 | |
- name: Setup App Context | |
run: | | |
set -ex | |
./scripts/${HOUSTON_APP_CONTEXT}/activate.sh | |
- name: Build swagger ui | |
run: | | |
./scripts/swagger/build.sh | |
# - name: Add 1GB of Swap | |
# uses: pierotofy/set-swap-space@master | |
# with: | |
# swap-size-gb: 1 | |
- name: Run docker-compose | |
run: | | |
set -ex | |
docker-compose up -d db redis elasticsearch elasticsearch2 elasticsearch3 sage sage-sync houston celery-beat celery-worker dev-frontend localhost | |
- name: Install dependencies | |
run: | | |
set -ex | |
# Display versions of geckodriver / chromedriver | |
geckodriver --version || echo 'no geckodriver' | |
chromedriver --version || echo 'no chromedriver' | |
chromium --version || echo 'no chromium' | |
google-chrome --version || echo 'no google-chrome' | |
pip install -r integration_tests/requirements.txt | |
- name: Check the state of the containers | |
run: | | |
set -ex | |
# Wait until houston is up | |
while sleep 15 | |
do | |
docker-compose logs houston | tail | |
docker-compose ps | |
if [ -n "$(docker-compose ps | grep Exit)" ] | |
then | |
exit 1 | |
fi | |
# Wait for houston to be ready | |
wget --tries=1 -O - --header='Host: localhost:84' http://127.0.0.1:83/api/v1/users/admin_user_initialized && break | |
done | |
# Wait for frontend to be ready | |
while sleep 10 | |
do | |
wget --tries=1 -O - http://localhost:84/ && break | |
done | |
# Wait for sage to be ready | |
while sleep 10 | |
do | |
wget --tries=1 -O - http://localhost:82/ && break | |
done | |
- name: Run tests | |
run: | | |
set -ex | |
# Need -c integration_tests/conftest.py otherwise it tries to use tests/conftest.py | |
pytest -s -vv -c integration_tests/conftest.py integration_tests/ | |
- name: Show docker-compose logs if failed | |
if: failure() | |
run: | | |
docker-compose logs --tail=250 | |
docker-compose ps | |
- name: Show sage logs if failed | |
if: failure() | |
run: | | |
docker-compose logs --no-color sage sage-sync | |
- name: Show houston logs if failed | |
if: failure() | |
run: | | |
docker-compose logs --no-color houston | sed -e 's/\x1b\[[0-9;]*m//g' -e 's/\x1b\[[0-9;]*m//g' -e 's/\x1b\]8;\(id=[0-9]*\)\?;//g' -e 's/\x1b\\//g' | |
- name: Upload codex.html and codex.png if failed | |
if: failure() | |
uses: actions/upload-artifact@v2 | |
with: | |
path: | | |
codex.html | |
codex.png | |
retention-days: 3 |