FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Move test executions to Justfile · pythonnet/pythonnet@45a7281 · GitHub

Repository navigation

Commit 45a7281

Browse files
committed
Move test executions to Justfile
1 parent 33b9fd2 commit 45a7281

3 files changed

Lines changed: 53 additions & 9 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656
- name: Checkout code
5757
uses: actions/checkout@v7
5858

59+
- name: Setup just
60+
uses: extractions/setup-just@v4
61+
5962
# Use main until support for architecture lands
6063
- name: Setup .NET
6164
uses: actions/setup-dotnet@main
@@ -83,25 +86,25 @@ jobs:
8386

8487
- name: Embedding tests (Mono/.NET Framework)
8588
if: always()
86-
run: dotnet test --runtime any-${{ matrix.os.platform }} --framework net472 --logger "console;verbosity=detailed" src/embed_tests/
89+
run: just test-embed-mono ${{ matrix.os.platform }}
8790
env:
8891
MONO_THREADS_SUSPEND: preemptive # https://github.com/mono/mono/issues/21466
8992

9093
- name: Embedding tests (.NET Core)
9194
if: always()
92-
run: dotnet test --runtime any-${{ matrix.os.platform }} --framework net10.0 --logger "console;verbosity=detailed" src/embed_tests/
95+
run: just test-embed-core ${{ matrix.os.platform }}
9396

9497
- name: Python Tests (.NET Core)
9598
if: always()
96-
run: pytest --runtime coreclr
99+
run: just test-python-coreclr
97100

98101
- name: Python Tests (Mono)
99102
if: always()
100-
run: pytest --runtime mono
103+
run: just test-python-mono
101104

102105
- name: Python Tests (.NET Framework)
103106
if: ${{ matrix.os.category == 'windows' }}
104-
run: pytest --runtime netfx
107+
run: just test-python-netfx
105108

106109
- name: Python tests run from .NET
107-
run: dotnet test --runtime any-${{ matrix.os.platform }} src/python_tests_runner/
110+
run: just test-python-from-dotnet ${{ matrix.os.platform }}

‎.github/workflows/nuget-preview.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: Checkout code
2424
uses: actions/checkout@v7
2525

26+
- name: Setup just
27+
uses: extractions/setup-just@v4
28+
2629
- name: Setup .NET
2730
uses: actions/setup-dotnet@v6
2831
with:
@@ -44,10 +47,10 @@ jobs:
4447
echo PYTHONNET_PYDLL=$(python -m find_libpython) >> $GITHUB_ENV
4548
4649
- name: Python Tests
47-
run: pytest
50+
run: just test-python
4851

4952
- name: Embedding tests
50-
run: dotnet test --runtime any-ubuntu src/embed_tests/
53+
run: just test-embed any-ubuntu
5154

5255
- name: Pack
5356
run: dotnet pack --configuration Release --version-suffix preview${{env.DATE_VER}} --output "Release-Preview"

‎Justfile‎

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
default:
22
@just --choose
33

4+
default_platform := if arch() == "x86_64" { "x64" } else if arch() == "aarch64" { "arm64" } else { arch() }
5+
46
setup:
57
dotnet restore
68
uv sync
@@ -11,4 +13,40 @@ docs:
1113

1214
build-wheels:
1315
uv build
14-
uv build --wheel -C="--global-option=--net46-support"
16+
uv build --wheel -C="--global-option=--net46-support"
17+
18+
# Run default tests (.NET Core Python and embedding tests)
19+
test: test-python-coreclr test-embed-core
20+
21+
# Run Python tests (default or pass options like --runtime coreclr)
22+
test-python *args:
23+
uv run pytest {{ args }}
24+
25+
# Run Python tests with .NET Core
26+
test-python-coreclr *args:
27+
uv run pytest --runtime coreclr {{ args }}
28+
29+
# Run Python tests with Mono
30+
test-python-mono *args:
31+
uv run pytest --runtime mono {{ args }}
32+
33+
# Run Python tests with .NET Framework
34+
test-python-netfx *args:
35+
uv run pytest --runtime netfx {{ args }}
36+
37+
# Run Python tests executed via .NET test runner
38+
test-python-from-dotnet platform=default_platform *args:
39+
dotnet test --runtime any-{{ platform }} src/python_tests_runner/ {{ args }}
40+
41+
# Run embedding tests
42+
test-embed runtime=("any-" + default_platform) *args:
43+
dotnet test --runtime {{ runtime }} src/embed_tests/ {{ args }}
44+
45+
# Run embedding tests with .NET Core
46+
test-embed-core platform=default_platform *args:
47+
dotnet test --runtime any-{{ platform }} --framework net10.0 --logger "console;verbosity=detailed" src/embed_tests/ {{ args }}
48+
49+
# Run embedding tests with Mono / .NET Framework
50+
[env("MONO_THREADS_SUSPEND", "preemptive")]
51+
test-embed-mono platform=default_platform *args:
52+
dotnet test --runtime any-{{ platform }} --framework net472 --logger "console;verbosity=detailed" src/embed_tests/ {{ args }}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL