Skip to content

Commit

Permalink
Mockaway resources in test (#8)
Browse files Browse the repository at this point in the history
* Only run non slow tests in CI

* Update dep and add mock

* Refactor

* Remove unused imports

* Remove commented out-code

* Mockaway resources

* Update noxfile to use pytest marker

* Simplify CI

* Fix CI

* Remove CI dep
  • Loading branch information
dobraczka authored Mar 6, 2024
1 parent 9246493 commit 79aa161
Show file tree
Hide file tree
Showing 12 changed files with 5,858 additions and 627 deletions.
60 changes: 7 additions & 53 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,21 @@ on:


jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Set pystow dir
run: |
echo "PYSTOW_HOME=" >> $GITHUB_ENV
echo "PYSTOW_NAME=data" >> $GITHUB_ENV
- uses: actions/cache@v3
id: cache
with:
path: data
key: alwaysthesame
enableCrossOsArchive: True
- name: Test
run:
nox

other:
needs: ubuntu
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7]
os: [macos-latest, windows-latest]

os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Set pystow dir windows
if: runner.os == 'Windows'
run: |
echo "PYSTOW_HOME=" >> $env:GITHUB_ENV
echo "PYSTOW_NAME=data" >> $env:GITHUB_ENV
- name: Set pystow dir mac
if: runner.os == 'macOS'
run: |
echo "PYSTOW_HOME=" >> $GITHUB_ENV
echo "PYSTOW_NAME=data" >> $GITHUB_ENV
- uses: actions/cache/restore@v3
id: cache
with:
path: data
key: alwaysthesame
enableCrossOsArchive: True
- name: Test
run:
nox
run: nox -s tests -- -m "not slow"
7 changes: 4 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

@nox.session
def tests(session):
session.install("pytest")
args = session.posargs or []
session.install(".")
session.install("requests")
session.install("pytest")
session.install("tqdm")
session.install("pandas")
session.install("pystow")
session.run("pytest")
session.run("pytest", *args)

723 changes: 410 additions & 313 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repository = "https://github.com/ScaDS/MovieGraphBenchmark"


[tool.poetry.dependencies]
python = ">=3.7.1"
python = ">=3.8"
requests = "*"
tqdm = "*"
pandas = "*"
Expand All @@ -17,10 +17,16 @@ pystow = "*"
[tool.poetry.scripts]
moviegraphbenchmark = "moviegraphbenchmark.create_graph:create_graph_data"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
ipdb = "^0.13.9"
pytest = "^7.1.2"
pytest = "^8.0.0"
pytest-mock = "^3.12.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
markers = [
"slow: mark test as slow"
]
Loading

0 comments on commit 79aa161

Please sign in to comment.