Skip to content

Commit b842029

Browse files
committed
Added unrun tests to CI
1 parent 7dcf614 commit b842029

File tree

6 files changed

+145
-0
lines changed

6 files changed

+145
-0
lines changed

.github/workflows/test_client_macos_nightlies.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ jobs:
161161
python -m pytest -x
162162
-m config -c /dev/null -p no:warnings
163163
-n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
164+
scenario_tests:
165+
runs-on: ubuntu-latest
166+
timeout-minutes: 30
167+
steps:
168+
- uses: actions/checkout@v5
169+
- name: Set up Python 3.14
170+
uses: actions/setup-python@v6
171+
with:
172+
python-version: "3.14"
173+
- name: Install dependencies
174+
run: |
175+
python -m pip install poetry
176+
poetry self add poetry-plugin-export
177+
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
178+
python -m pip install -r requirements.txt
179+
python -m pip install .
180+
- name: Test with pytest
181+
env:
182+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
183+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
184+
run: >-
185+
python -m pytest -x
186+
-m "scenario and not run" -c /dev/null -p no:warnings
187+
-n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
164188
executor_tests:
165189
runs-on: ubuntu-latest
166190
timeout-minutes: 30

.github/workflows/test_client_ubuntu.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,30 @@ jobs:
166166
python -m pytest -x
167167
-m config -c /dev/null -p no:warnings
168168
-n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
169+
scenario_tests:
170+
runs-on: ubuntu-latest
171+
timeout-minutes: 30
172+
steps:
173+
- uses: actions/checkout@v5
174+
- name: Set up Python 3.14
175+
uses: actions/setup-python@v6
176+
with:
177+
python-version: "3.14"
178+
- name: Install dependencies
179+
run: |
180+
python -m pip install poetry
181+
poetry self add poetry-plugin-export
182+
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
183+
python -m pip install -r requirements.txt
184+
python -m pip install .
185+
- name: Test with pytest
186+
env:
187+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
188+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
189+
run: >-
190+
python -m pytest -x
191+
-m "scenario and not run" -c /dev/null -p no:warnings
192+
-n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
169193
executor_tests:
170194
runs-on: ubuntu-latest
171195
timeout-minutes: 30

.github/workflows/test_client_ubuntu_nightlies.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,30 @@ jobs:
164164
python -m pytest -x
165165
-m config -c /dev/null -p no:warnings
166166
-n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
167+
scenario_tests:
168+
runs-on: ubuntu-latest
169+
timeout-minutes: 30
170+
steps:
171+
- uses: actions/checkout@v5
172+
- name: Set up Python 3.14
173+
uses: actions/setup-python@v6
174+
with:
175+
python-version: "3.14"
176+
- name: Install dependencies
177+
run: |
178+
python -m pip install poetry
179+
poetry self add poetry-plugin-export
180+
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
181+
python -m pip install -r requirements.txt
182+
python -m pip install .
183+
- name: Test with pytest
184+
env:
185+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
186+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
187+
run: >-
188+
python -m pytest -x
189+
-m "scenario and not run" -c /dev/null -p no:warnings
190+
-n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
167191
executor_tests:
168192
runs-on: ubuntu-latest
169193
timeout-minutes: 30

.github/workflows/test_client_windows_nightlies.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,30 @@ jobs:
167167
-m 'config and not unix' -c /dev/null -p no:warnings
168168
-n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
169169
shell: pwsh
170+
scenario_tests:
171+
runs-on: ubuntu-latest
172+
timeout-minutes: 30
173+
steps:
174+
- uses: actions/checkout@v5
175+
- name: Set up Python 3.14
176+
uses: actions/setup-python@v6
177+
with:
178+
python-version: "3.14"
179+
- name: Install dependencies
180+
run: |
181+
python -m pip install poetry
182+
poetry self add poetry-plugin-export
183+
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
184+
python -m pip install -r requirements.txt
185+
python -m pip install .
186+
- name: Test with pytest
187+
env:
188+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
189+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
190+
run: >-
191+
python -m pytest -x
192+
-m scenario -c /dev/null -p no:warnings
193+
-n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
170194
executor_tests:
171195
runs-on: windows-latest
172196
timeout-minutes: 30

.github/workflows/test_multiple_python.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,30 @@ jobs:
194194
python -m pytest -x
195195
-m config -c /dev/null -p no:warnings
196196
-n 8 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
197+
scenario_tests:
198+
runs-on: ubuntu-latest
199+
timeout-minutes: 30
200+
steps:
201+
- uses: actions/checkout@v5
202+
- name: Set up Python 3.14
203+
uses: actions/setup-python@v6
204+
with:
205+
python-version: "3.14"
206+
- name: Install dependencies
207+
run: |
208+
python -m pip install poetry
209+
poetry self add poetry-plugin-export
210+
poetry export -f requirements.txt --with dev -o requirements.txt --all-extras
211+
python -m pip install -r requirements.txt
212+
python -m pip install .
213+
- name: Test with pytest
214+
env:
215+
SIMVUE_URL: ${{ secrets.SIMVUE_URL }}
216+
SIMVUE_TOKEN: ${{ secrets.SIMVUE_TOKEN }}
217+
run: >-
218+
python -m pytest -x
219+
-m "scenario and not run" -c /dev/null -p no:warnings
220+
-n 0 -v -o cache_dir=${GITHUB_WORKSPACE}/.pytest-cache
197221
executor_tests:
198222
runs-on: ubuntu-latest
199223
name: Executor Tests

tests/functional/test_run_class.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535

3636
@pytest.mark.run
37+
@pytest.mark.online
3738
def test_created_run(request) -> None:
3839
_uuid = f"{uuid.uuid4()}".split("-")[0]
3940
with sv_run.Run() as run_created:
@@ -151,6 +152,7 @@ def test_run_with_emissions_offline(speedy_heartbeat, mock_co2_signal, create_pl
151152
assert _total_values[i] == _total_values[i - 1] + _delta_values[i]
152153

153154
@pytest.mark.run
155+
@pytest.mark.online
154156
@pytest.mark.parametrize(
155157
"timestamp",
156158
(datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S.%f"), None),
@@ -355,6 +357,7 @@ def test_log_metrics_offline(
355357
assert len(_steps) == 1
356358

357359
@pytest.mark.run
360+
@pytest.mark.online
358361
@pytest.mark.parametrize(
359362
"visibility", ("bad_option", "tenant", "public", ["user01"], None)
360363
)
@@ -468,6 +471,7 @@ def test_visibility_offline(
468471
)
469472

470473
@pytest.mark.run
474+
@pytest.mark.online
471475
def test_log_events_online(create_test_run: tuple[sv_run.Run, dict]) -> None:
472476
EVENT_MSG = "Hello world!"
473477
run, _ = create_test_run
@@ -535,6 +539,7 @@ def test_update_metadata_running(create_test_run: tuple[sv_run.Run, dict]) -> No
535539

536540

537541
@pytest.mark.run
542+
@pytest.mark.online
538543
def test_update_metadata_created(create_pending_run: tuple[sv_run.Run, dict]) -> None:
539544
METADATA = {"a": 1, "b": 1.2, "c": "word", "d": "new"}
540545
run, _ = create_pending_run
@@ -577,6 +582,7 @@ def test_update_metadata_offline(
577582

578583

579584
@pytest.mark.run
585+
@pytest.mark.online
580586
@pytest.mark.scenario
581587
@pytest.mark.parametrize("multi_threaded", (True, False), ids=("multi", "single"))
582588
def test_runs_multiple_parallel(
@@ -678,6 +684,7 @@ def thread_func(index: int) -> tuple[int, list[dict[str, typing.Any]], str]:
678684

679685

680686
@pytest.mark.run
687+
@pytest.mark.online
681688
@pytest.mark.scenario
682689
def test_runs_multiple_series(request: pytest.FixtureRequest) -> None:
683690
N_RUNS: int = 2
@@ -729,6 +736,7 @@ def test_runs_multiple_series(request: pytest.FixtureRequest) -> None:
729736

730737

731738
@pytest.mark.run
739+
@pytest.mark.online
732740
@pytest.mark.parametrize("post_init", (True, False), ids=("pre-init", "post-init"))
733741
def test_suppressed_errors(
734742
setup_logging: "CountingLogHandler", post_init: bool, request: pytest.FixtureRequest
@@ -778,13 +786,15 @@ def test_suppressed_errors(
778786

779787

780788
@pytest.mark.run
789+
@pytest.mark.online
781790
def test_bad_run_arguments() -> None:
782791
with sv_run.Run() as run:
783792
with pytest.raises(RuntimeError):
784793
run.init("sdas", [34])
785794

786795

787796
@pytest.mark.run
797+
@pytest.mark.online
788798
def test_set_folder_details(request: pytest.FixtureRequest) -> None:
789799
_uuid = f"{uuid.uuid4()}".split("-")[0]
790800
with sv_run.Run() as run:
@@ -819,6 +829,7 @@ def test_set_folder_details(request: pytest.FixtureRequest) -> None:
819829

820830

821831
@pytest.mark.run
832+
@pytest.mark.online
822833
@pytest.mark.parametrize(
823834
"snapshot", (True, False)
824835
)
@@ -979,6 +990,7 @@ def test_save_file_offline(
979990
assert content == "test data entry"
980991

981992
@pytest.mark.run
993+
@pytest.mark.online
982994
def test_update_tags_running(
983995
create_plain_run: tuple[sv_run.Run, dict],
984996
request: pytest.FixtureRequest,
@@ -1003,6 +1015,7 @@ def test_update_tags_running(
10031015

10041016

10051017
@pytest.mark.run
1018+
@pytest.mark.online
10061019
def test_update_tags_created(
10071020
create_pending_run: tuple[sv_run.Run, dict],
10081021
request: pytest.FixtureRequest,
@@ -1052,6 +1065,7 @@ def test_update_tags_offline(
10521065

10531066

10541067
@pytest.mark.run
1068+
@pytest.mark.online
10551069
@pytest.mark.parametrize("object_type", ("DataFrame", "ndarray"))
10561070
def test_save_object(
10571071
create_plain_run: tuple[sv_run.Run, dict], object_type: str
@@ -1074,6 +1088,7 @@ def test_save_object(
10741088

10751089

10761090
@pytest.mark.run
1091+
@pytest.mark.online
10771092
def test_add_alerts() -> None:
10781093
_uuid = f"{uuid.uuid4()}".split("-")[0]
10791094

@@ -1259,6 +1274,7 @@ def test_add_alerts_offline(monkeypatch) -> None:
12591274

12601275

12611276
@pytest.mark.run
1277+
@pytest.mark.online
12621278
def test_log_alert() -> None:
12631279
_uuid = f"{uuid.uuid4()}".split("-")[0]
12641280

@@ -1309,6 +1325,7 @@ def test_log_alert() -> None:
13091325

13101326

13111327
@pytest.mark.run
1328+
@pytest.mark.online
13121329
def test_abort_on_alert_process(mocker: pytest_mock.MockerFixture) -> None:
13131330
def testing_exit(status: int) -> None:
13141331
raise SystemExit(status)
@@ -1362,6 +1379,7 @@ def abort_callback(abort_run=trigger) -> None:
13621379

13631380

13641381
@pytest.mark.run
1382+
@pytest.mark.online
13651383
def test_abort_on_alert_python(
13661384
speedy_heartbeat, create_plain_run: tuple[sv_run.Run, dict], mocker: pytest_mock.MockerFixture
13671385
) -> None:
@@ -1382,6 +1400,7 @@ def test_abort_on_alert_python(
13821400

13831401

13841402
@pytest.mark.run
1403+
@pytest.mark.online
13851404
def test_abort_on_alert_raise(
13861405
create_plain_run: tuple[sv_run.Run, dict]
13871406
) -> None:
@@ -1406,6 +1425,7 @@ def test_abort_on_alert_raise(
14061425

14071426

14081427
@pytest.mark.run
1428+
@pytest.mark.online
14091429
def test_kill_all_processes(create_plain_run: tuple[sv_run.Run, dict]) -> None:
14101430
run, _ = create_plain_run
14111431
run.config(system_metrics_interval=1)
@@ -1421,6 +1441,7 @@ def test_kill_all_processes(create_plain_run: tuple[sv_run.Run, dict]) -> None:
14211441

14221442

14231443
@pytest.mark.run
1444+
@pytest.mark.online
14241445
def test_run_created_with_no_timeout() -> None:
14251446
_uuid = f"{uuid.uuid4()}".split("-")[0]
14261447
with simvue.Run() as run:
@@ -1443,6 +1464,7 @@ def test_run_created_with_no_timeout() -> None:
14431464

14441465
@pytest.mark.parametrize("mode", ("online", "offline"), ids=("online", "offline"))
14451466
@pytest.mark.run
1467+
@pytest.mark.online
14461468
def test_reconnect_functionality(mode, monkeypatch: pytest.MonkeyPatch) -> None:
14471469
temp_d: tempfile.TemporaryDirectory | None = None
14481470
_uuid = f"{uuid.uuid4()}".split("-")[0]
@@ -1486,6 +1508,7 @@ def test_reconnect_functionality(mode, monkeypatch: pytest.MonkeyPatch) -> None:
14861508

14871509

14881510
@pytest.mark.run
1511+
@pytest.mark.online
14891512
def test_env_var_metadata() -> None:
14901513
# Add some environment variables to glob
14911514
_recorded_env = {
@@ -1506,6 +1529,7 @@ def test_env_var_metadata() -> None:
15061529
assert all(key in _recorded_meta.get("shell") for key in _recorded_env)
15071530

15081531
@pytest.mark.run
1532+
@pytest.mark.online
15091533
def test_reconnect_with_process() -> None:
15101534
_uuid = f"{uuid.uuid4()}".split("-")[0]
15111535
with simvue.Run() as run:
@@ -1537,6 +1561,7 @@ def test_reconnect_with_process() -> None:
15371561
@pytest.mark.parametrize(
15381562
"environment", ("python_conda", "python_poetry", "python_uv", "julia", "rust", "nodejs")
15391563
)
1564+
@pytest.mark.online
15401565
def test_run_environment_metadata(environment: str, mocker: pytest_mock.MockerFixture) -> None:
15411566
"""Tests that the environment information is compatible with the server."""
15421567
from simvue.config.user import SimvueConfiguration

0 commit comments

Comments
 (0)