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
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: ci
on:
push:
pull_request:
env:
TRANSPORT_RELEASE: v0.2.0
TRANSPORT_REV: 553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542
jobs:
test:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -29,19 +32,19 @@ jobs:
- uses: actions/cache@v4
id: transport
with:
path: ~/transport-44a9c7abde5a35d869c5f71780d56e26c0c6f8bd
key: transport-44a9c7abde5a35d869c5f71780d56e26c0c6f8bd-${{ runner.os }}-${{ runner.arch }}
path: ~/transport-${{ env.TRANSPORT_REV }}
key: transport-${{ env.TRANSPORT_REV }}-${{ runner.os }}-${{ runner.arch }}
- if: steps.transport.outputs.cache-hit != 'true'
uses: dtolnay/rust-toolchain@stable
- if: steps.transport.outputs.cache-hit != 'true'
name: build transport
run: |
CARGO_TARGET_DIR="$RUNNER_TEMP/transport-target" cargo install --locked \
--git https://github.com/selectiveci/transport --rev 44a9c7abde5a35d869c5f71780d56e26c0c6f8bd \
--bin transport --bin transport-conformance --root ~/transport-44a9c7abde5a35d869c5f71780d56e26c0c6f8bd
--git https://github.com/selectiveci/transport --rev "$TRANSPORT_REV" \
--bin transport --bin transport-conformance --root ~/transport-"$TRANSPORT_REV"
- name: transport
run: echo "SELECTIVE_TRANSPORT=$HOME/transport-44a9c7abde5a35d869c5f71780d56e26c0c6f8bd/bin/transport" >> "$GITHUB_ENV"
run: echo "SELECTIVE_TRANSPORT=$HOME/transport-$TRANSPORT_REV/bin/transport" >> "$GITHUB_ENV"
- name: verify
run: mvn -B verify -Djunit.version=${{ matrix.junit }} ${{ matrix.extra }}
- name: conformance
run: scripts/conformance.sh "$HOME/transport-44a9c7abde5a35d869c5f71780d56e26c0c6f8bd/bin/transport-conformance" "$SELECTIVE_TRANSPORT" -Djunit.version=${{ matrix.junit }} ${{ matrix.extra }}
run: scripts/conformance.sh "$HOME/transport-$TRANSPORT_REV/bin/transport-conformance" "$SELECTIVE_TRANSPORT" -Djunit.version=${{ matrix.junit }} ${{ matrix.extra }}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The provider dependency has to sit on the plugin, next to `<configuration>`. A d

The first time it runs, the client downloads the transport release it was built against. It checks the archive's SHA-256 against the checksum built into the jar, then caches the binary as `~/.selective/transport/<version>/transport-<OS>-<arch>`. Linux binaries are static, so one binary serves glibc and musl systems such as Alpine. The download goes through the JVM's proxy settings (`https.proxyHost`, `https.proxyPort`). `SELECTIVE_TRANSPORT` names a binary and skips the download. `SELECTIVE_TRANSPORT_RELEASES` replaces `https://github.com/selectiveci/transport/releases/download` with a mirror that has the same layout. The pinned release is `transport.version` in the root pom, with one `transport.sha256.<OS>-<arch>` per target.

The pin is `0.0.0-44a9c7a`: a static Linux x86_64 build of `selectiveci/transport` at `44a9c7abde5a35d869c5f71780d56e26c0c6f8bd`. No release carries it yet, so point `SELECTIVE_TRANSPORT_RELEASES` at a mirror that serves `v0.0.0-44a9c7a/transport-Linux-x86_64.tar.gz`, or build the transport at that commit and set `SELECTIVE_TRANSPORT`. The pin has no build for macOS or Linux aarch64; there the client exits 1 and asks for `SELECTIVE_TRANSPORT`. The URL and API key travel in `SELECTIVE_TRANSPORT_URL`, which the client sets for the child. They are not process arguments.
The pin is release `v0.2.0` of `selectiveci/transport`, which ships Linux (static) and macOS builds for x86_64 and aarch64. There is no Windows build; there the client exits 1 as an unsupported platform. The URL and API key travel in `SELECTIVE_TRANSPORT_URL`, which the client sets for the child. They are not process arguments.

`transport --build-env` supplies the run identity. These must be set and non-empty, or the client exits 1 and names the missing variables:

Expand Down Expand Up @@ -78,20 +78,20 @@ java -cp <classes-and-deps> ci.selective.junit.Main --dry-run --package com.exam

## Tests

Build `transport` and `transport-conformance` at the pinned commit:
Build `transport` and `transport-conformance` at the v0.2.0 commit:

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

Use a fresh `CARGO_TARGET_DIR` for each commit, since a reused one can install stale binaries. Then, with `SELECTIVE_TRANSPORT` pointing at `~/transport-44a9c7a/bin/transport`:
Use a fresh `CARGO_TARGET_DIR` for each commit, since a reused one can install stale binaries. Then, with `SELECTIVE_TRANSPORT` pointing at `~/transport-553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542/bin/transport`:

```
mvn -B verify
mvn -B verify -Djunit.version=5.12.2 -Dselective.noClassTemplate
mvn -B verify -Djunit.version=5.11.4 -Dselective.noClassTemplate
scripts/conformance.sh ~/transport-44a9c7a/bin/transport-conformance "$SELECTIVE_TRANSPORT"
scripts/conformance.sh ~/transport-553bb45b8bfa3ac9c9f7ed1ad71a8ac19d384542/bin/transport-conformance "$SELECTIVE_TRANSPORT"
```

`scripts/conformance.sh` runs the transport's own conformance suite against the client twice: once as a plain runner, and once with the JaCoCo agent so the recording scenarios run.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
version=${transport.version}
sha256.Darwin-aarch64=${transport.sha256.Darwin-aarch64}
sha256.Darwin-x86_64=${transport.sha256.Darwin-x86_64}
sha256.Linux-aarch64=${transport.sha256.Linux-aarch64}
sha256.Linux-x86_64=${transport.sha256.Linux-x86_64}
8 changes: 4 additions & 4 deletions core/src/test/java/ci/selective/junit/runtime/BinaryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ void namesTheReleaseTargets() {
}

@Test
void thePinShipsTheStaticLinuxBuild() {
void thePinShipsEveryReleaseTarget() {
Binary.Pin pin = Binary.Pin.load();
assertEquals("0.0.0-44a9c7a", pin.version());
assertEquals(Set.of("Linux-x86_64"), pin.sha256().keySet());
assertTrue(pin.sha256().get("Linux-x86_64").matches("[0-9a-f]{64}"), pin.sha256().toString());
assertEquals("0.2.0", pin.version());
assertEquals(Set.of("Darwin-aarch64", "Darwin-x86_64", "Linux-aarch64", "Linux-x86_64"), pin.sha256().keySet());
pin.sha256().values().forEach(hash -> assertTrue(hash.matches("[0-9a-f]{64}"), hash));
}

@Test
Expand Down
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
<junit.version>5.13.4</junit.version>
<surefire.version>3.2.5</surefire.version>
<gson.version>2.11.0</gson.version>
<transport.version>0.0.0-44a9c7a</transport.version>
<transport.sha256.Linux-x86_64>6b69e58eb0bdabde31232fd6b1c21fe660932f0adededbbbbf35dcbf13870996</transport.sha256.Linux-x86_64>
<transport.version>0.2.0</transport.version>
<transport.sha256.Darwin-aarch64>7dcaec969378a181a62749673b9c0b658be17bf16a8880f5effbd8e03a6c4a17</transport.sha256.Darwin-aarch64>
<transport.sha256.Darwin-x86_64>ccb9f795086d5584ff605cff8aefc534a82cde3154a3231f7f9396cde27bf7d4</transport.sha256.Darwin-x86_64>
<transport.sha256.Linux-aarch64>cf54fbf596b8a708fbc64e031f98737f076b8c32c371a4506c8141c49bca84be</transport.sha256.Linux-aarch64>
<transport.sha256.Linux-x86_64>87b2d6847ed0efa44c73ec16526b85134bf6f2e3759d99f925682eaf1b27d937</transport.sha256.Linux-x86_64>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
Loading