Skip to content

Commit 0d0d181

Browse files
author
Rasmus Oscar Welander
committed
Added build step to CI
1 parent 96fd811 commit 0d0d181

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.github/workflows/ci-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Linting and unit tests
4+
name: Lint, Build and Test
55
on:
66
push:
77
branches: [ "main" ]
@@ -32,8 +32,11 @@ jobs:
3232
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3333
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide, we further relax this
3434
flake8 . --count --exit-zero --max-complexity=30 --max-line-length=130 --statistics
35-
35+
- name: Build
36+
run: |
37+
pip install build
38+
python -m build
3639
- name: Test with pytest
3740
run: |
3841
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
39-
pytest --cov-report term --cov=src tests/
42+
pytest --cov-report term --cov=cs3client tests/

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ dmypy.json
157157
# Cython debug symbols
158158
cython_debug/
159159

160-
# MacOS
161-
.DS_Store
162-
163160
# PyCharm
164161
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165162
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore

tests/fixtures.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from configparser import ConfigParser
1515
import base64
1616
import json
17+
import cs3.rpc.v1beta1.code_pb2 as cs3code
1718

1819
from cs3client.cs3client import CS3Client
1920
from cs3client.file import File
@@ -86,6 +87,12 @@ def mock_status_code_handler(mock_logger, mock_config):
8687
def mock_gateway(mock_gateway_stub_class):
8788
mock_gateway_stub = Mock()
8889
mock_gateway_stub_class.return_value = mock_gateway_stub
90+
mocked_token = create_mock_jwt()
91+
mock_authenticate_response = Mock()
92+
mock_authenticate_response.status.code = cs3code.CODE_OK
93+
mock_authenticate_response.status.message = ""
94+
mock_authenticate_response.token = mocked_token
95+
mock_gateway_stub.Authenticate.return_value = mock_authenticate_response
8996
return mock_gateway_stub
9097

9198

0 commit comments

Comments
 (0)