Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server tests #91

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
MarkLark86 marked this conversation as resolved.
Show resolved Hide resolved
}]}
"""

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
Loading