Skip to content

Commit

Permalink
Fix server tests (#91)
Browse files Browse the repository at this point in the history
* fix server tests

* fix events tests
  • Loading branch information
petrjasek authored Sep 2, 2024
1 parent 6ba2a6d commit c5e4a7b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 38 deletions.
42 changes: 10 additions & 32 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,43 +31,30 @@ jobs:
working-directory: server

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.8'

- name: apt-get
run: |
sudo apt-get update
sudo apt-get -y install libxml2-dev libxmlsec1-dev libxmlsec1-openssl libexempi-dev
- name: cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('server/dev-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
${{ runner.os }}-
- name: pip install
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -r dev-requirements.txt
python -m pip install -r dev-requirements.txt
- name: flake8
run: flake8
- run: flake8

- name: nosetests
run: nosetests tests
- run: pytest tests

- name: behave
run: behave --format progress2 --logging-level=ERROR
- run: behave --format progress2 --logging-level=ERROR

- name: initialize data
run: python manage.py app:initialize_data
- run: python manage.py app:initialize_data

client:
runs-on: ubuntu-latest
Expand All @@ -77,22 +64,13 @@ jobs:
working-directory: client

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x

- name: cache npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm
${{ runner.os }}-
- run: git config --global url."https://git@".insteadOf git://
- name: npm ci
run: npm install --no-audit
Expand Down
2 changes: 1 addition & 1 deletion server/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-r requirements.txt

flake8
nose
pep8
httmock
wooper
pytest
responses
10 changes: 5 additions & 5 deletions server/features/ingest_events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Feature: Ingest STT Event Items
"""
{"_items": [{
"guid": "urn:newsml:stt.fi:259431",
"state": "spiked"
"state": "killed"
}]}
"""

Expand All @@ -35,12 +35,12 @@ Feature: Ingest STT Event Items
"state": "ingested"
}]}
"""
When we post to "/events/post"
When we patch "/events/urn:newsml:stt.fi:259431"
"""
{
"event": "urn:newsml:stt.fi:259431",
"etag": "#events._etag#",
"pubstatus": "usable"
"pubstatus": "usable",
"state": "scheduled",
"update_method": "single"
}
"""
Then we get OK response
Expand Down

0 comments on commit c5e4a7b

Please sign in to comment.