Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ jobs:
transport:
runs-on: ubuntu-24.04
env:
TRANSPORT_SHA: 44a9c7abde5a35d869c5f71780d56e26c0c6f8bd
TRANSPORT_RELEASE: v0.2.0
TRANSPORT_REV: 553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542
steps:
- uses: dtolnay/rust-toolchain@stable
- name: build transport and transport-conformance
run: |
CARGO_TARGET_DIR="$RUNNER_TEMP/target-$TRANSPORT_SHA" cargo install --locked \
--git https://github.com/selectiveci/transport --rev "$TRANSPORT_SHA" \
CARGO_TARGET_DIR="$RUNNER_TEMP/target-$TRANSPORT_REV" cargo install --locked \
--git https://github.com/selectiveci/transport --rev "$TRANSPORT_REV" \
--bin transport --bin transport-conformance --root "$RUNNER_TEMP/transport"
- uses: actions/upload-artifact@v4
with:
Expand All @@ -23,7 +24,8 @@ jobs:
wheel:
runs-on: ubuntu-24.04
env:
TRANSPORT_SHA: 44a9c7abde5a35d869c5f71780d56e26c0c6f8bd
TRANSPORT_RELEASE: v0.2.0
TRANSPORT_REV: 553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542
PLATFORM_TAG: manylinux_2_17_x86_64.musllinux_1_1_x86_64
steps:
- uses: actions/checkout@v4
Expand All @@ -37,7 +39,7 @@ jobs:
run: |
sudo apt-get install -y musl-tools
git init -q "$RUNNER_TEMP/transport"
git -C "$RUNNER_TEMP/transport" fetch -q --depth 1 https://github.com/selectiveci/transport.git "$TRANSPORT_SHA"
git -C "$RUNNER_TEMP/transport" fetch -q --depth 1 https://github.com/selectiveci/transport.git "$TRANSPORT_REV"
git -C "$RUNNER_TEMP/transport" checkout -q FETCH_HEAD
cargo build --release --locked --target x86_64-unknown-linux-musl --bin transport --manifest-path "$RUNNER_TEMP/transport/Cargo.toml"
python -m pip install wheel
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ selective pytest tests
selective exec pytest tests -k tax
```

The Linux x86_64 platform wheel (`py3-none-manylinux_2_17_x86_64.musllinux_1_1_x86_64`) carries a static musl transport, so it runs on glibc and musl systems alike. `packaging/wheel.sh <transport binary> <platform tag>` builds it, and CI builds it from the pinned transport SHA. The client uses `SELECTIVE_TRANSPORT` when set, then the bundled binary, then `transport` on `PATH`. The binary must support `--stdio`. A missing binary, a transport without `--stdio`, and one that cannot execute each get their own error, and the transport's own stderr reaches the terminal. Set the usual Selective CI variables (`SELECTIVE_HOST`, `SELECTIVE_API_KEY`, `SELECTIVE_PLATFORM`, `SELECTIVE_RUN_ID`, `SELECTIVE_RUN_ATTEMPT`, `SELECTIVE_BRANCH`, `SELECTIVE_SHA`, `SELECTIVE_GIT_REPO`, `SELECTIVE_GIT_PROVIDER`). pytest-xdist workers are rejected with exit 4 whether `-n` comes from the command line or `addopts`; `-n0` is allowed.
The Linux x86_64 platform wheel (`py3-none-manylinux_2_17_x86_64.musllinux_1_1_x86_64`) carries a static musl transport, so it runs on glibc and musl systems alike. `packaging/wheel.sh <transport binary> <platform tag>` builds it, and CI builds it from the pinned transport tag. The client uses `SELECTIVE_TRANSPORT` when set, then the bundled binary, then `transport` on `PATH`. The binary must support `--stdio`. A missing binary, a transport without `--stdio`, and one that cannot execute each get their own error, and the transport's own stderr reaches the terminal. Set the usual Selective CI variables (`SELECTIVE_HOST`, `SELECTIVE_API_KEY`, `SELECTIVE_PLATFORM`, `SELECTIVE_RUN_ID`, `SELECTIVE_RUN_ATTEMPT`, `SELECTIVE_BRANCH`, `SELECTIVE_SHA`, `SELECTIVE_GIT_REPO`, `SELECTIVE_GIT_PROVIDER`). pytest-xdist workers are rejected with exit 4 whether `-n` comes from the command line or `addopts`; `-n0` is allowed.

A setup error prints a red block with the message and exits 1; `selective --debug pytest` raises it with a traceback instead. `selective --log pytest` writes every command received and every response sent to `log/<runner_id>.log`. Diff hints are relative to the directory pytest runs from, so a project in a subdirectory of the repository gets them too.

The example under `examples/django_skeleton` is a pytest-django project with database tests: `django_db`, a transactional test, and a `TestCase` with `setUpTestData`. Install its `requirements.txt` and run `selective pytest billing` from that directory.

## Tests

Build [transport](https://github.com/selectiveci/transport) and its conformance runner at `44a9c7abde5a35d869c5f71780d56e26c0c6f8bd`, using a fresh `CARGO_TARGET_DIR`:
Build [transport](https://github.com/selectiveci/transport) and its conformance runner at the `v0.2.0` commit, `553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542`, using a fresh `CARGO_TARGET_DIR`:

```
cargo install --locked --git https://github.com/selectiveci/transport --rev 44a9c7abde5a35d869c5f71780d56e26c0c6f8bd --bin transport --bin transport-conformance --root /path/to/transport
cargo install --locked --git https://github.com/selectiveci/transport --rev 553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542 --bin transport --bin transport-conformance --root /path/to/transport
```

Run the unit tests, then the transport's conformance suite against the fixture project in `conformance/`:
Expand Down
Loading