Skip to content

Commit

Permalink
wtf tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Sep 4, 2023
1 parent 21e2f9e commit 05f8d59
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.11"]

# Service containers to run with `container-job`
services:
# Label used to access the service container
Expand All @@ -32,27 +32,27 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
run: |
pytest tests
env:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test with pytest
run: |
pytest tests -k test_db_9 -s
env:
# Env vars for pytest
POSTGRES_USERNAME: postgres
POSTGRES_HOST: localhost
Expand All @@ -61,4 +61,4 @@ jobs:
POSTGRES_PLAYBACK_DB_NAME: postgres_playback_test
POSTGRES_PORT: 5432
DQM_CR_USERNAMES: "user:password"
- run: echo "🍏 This job's status is ${{ job.status }}."
- run: echo "🍏 This job's status is ${{ job.status }}."
1 change: 1 addition & 0 deletions tests/test_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def test_db_9(testing_database):
print("Check DQM2MirrorDB.get_graphs_data()")
truth = TEST_DB_9_TRUTH
answer = json.dumps(testing_database.get_graphs_data(358792))
print(answer)
assert truth == answer


Expand Down

0 comments on commit 05f8d59

Please sign in to comment.