File tree Expand file tree Collapse file tree 5 files changed +71
-0
lines changed
Expand file tree Collapse file tree 5 files changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ name : End-to-end tests
2+
3+ on :
4+ schedule :
5+ # run once a month at midnight of the first day of the month
6+ - cron : 0 0 1 * *
7+ workflow_dispatch : # run manually from actions tab
8+
9+ # Set permissions at the job level.
10+ permissions : {}
11+
12+ env :
13+ PYTHONUNBUFFERED : 1
14+ FORCE_COLOR : 1
15+ UV_LOCKED : true # do not update the lockfile during `uv sync` and `uv run` commands
16+
17+ jobs :
18+ test :
19+ name : Python ${{ matrix.python-version }}
20+ runs-on : ubuntu-24.04
21+ steps :
22+ - name : Set up just
23+ uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
24+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+ - name : Set up uv
26+ uses : astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
27+ with :
28+ python-version : ' 3.13'
29+ enable-cache : true
30+ prune-cache : false
31+ - name : Install project, including dev dependencies
32+ run : just sync
33+ - name : Run e2e tests
34+ run : just e2e-test
Original file line number Diff line number Diff line change 3434 run : just cov
3535 env :
3636 TERM : dumb # keep rich from printing escape sequences, which made testing CLI outputs messy
37+ - name : Run e2e tests
38+ run : just e2e-test
39+ if : matrix.python-version == '3.13'
3740 - name : Generate coverage report
3841 run : |
3942 export TOTAL_COV=$(hatch run cov-total)
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ check: lint typecheck
3131test :
3232 uv run pytest tests
3333
34+ [group (' test' )]
35+ e2e-test :
36+ uv run pytest -m e2e
37+
3438[group (' test' )]
3539cov :
3640 uv run pytest --cov=src
Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ addopts = [
170170 " --showlocals" ,
171171 " --strict-markers" ,
172172 " --strict-config" ,
173+ " -m not e2e" , # default behaviour: do not run e2e tests
173174]
174175asyncio_mode = " auto"
175176filterwarnings = [
@@ -178,6 +179,9 @@ filterwarnings = [
178179log_cli_level = " INFO"
179180xfail_strict = true
180181testpaths = " tests"
182+ markers = [
183+ " e2e: marks tests as end-to-end tests, requesting the live api" ,
184+ ]
181185
182186[tool .coverage .run ] # Ref: https://coverage.readthedocs.io/en/latest/config.html
183187branch = true
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2025 Heinz-Alexander Fütterer
2+ #
3+ # SPDX-License-Identifier: MIT
4+
5+ from __future__ import annotations
6+
7+ import pytest
8+
9+ import re3data
10+ from re3data ._resources import Repository , RepositoryName , RepositorySummary
11+
12+ pytestmark = pytest .mark .e2e
13+
14+
15+ def test_get_single_repository (zenodo_id : str ) -> None :
16+ response = re3data .repositories .get (zenodo_id )
17+ assert isinstance (response , Repository )
18+ assert response .id == zenodo_id
19+ assert isinstance (response .repository_name , RepositoryName )
20+ assert response .repository_name .value == "Zenodo"
21+
22+
23+ def test_list_repositories_query_string () -> None :
24+ response = re3data .repositories .list (query = "biosharing" )
25+ assert isinstance (response , list )
26+ assert isinstance (response [0 ], RepositorySummary )
You can’t perform that action at this time.
0 commit comments