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
22 changes: 22 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,28 @@ jobs:
# Run E2E tests
- name: Run E2E tests
run: npx nx run backend-apisix-standalone:test

# Run the Rust port's E2E tests against the same live cluster. Each
# test function restarts every instance itself before it starts
# (see adc-backend-apisix-standalone's tests/common/mod.rs), so
# running after the TS suite here is safe — nothing from the TS
# suite's own state survives into the Rust tests.
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
workspaces: rust -> target
- name: Run Rust E2E tests
working-directory: ./rust
run: |
rustup update stable
rustup default stable
cargo test -p adc-backend-apisix-standalone -- --ignored --test-threads=1
# Only useful when the step above fails: a bare 404 from an admin API
# request gives no clue why on its own — the container's own error
# log does.
- name: Dump APISIX standalone container logs
if: failure()
working-directory: ./libs/backend-apisix-standalone/e2e/assets
run: docker compose logs --no-color
api7:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'test/api7') || github.event_name == 'push'
Expand Down
80 changes: 79 additions & 1 deletion rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/adc-backend-core",
"crates/adc-backend-apisix",
"crates/adc-backend-api7",
"crates/adc-backend-apisix-standalone",
"crates/adc-sync-bench",
"crates/adc-mock-server",
"crates/adc-cli",
Expand Down
4 changes: 2 additions & 2 deletions rust/crates/adc-backend-api7/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Operator {
Ok(result) => results.push(result),
Err((event, error)) => results.push(BackendSyncResult {
success: false,
event,
event: Some(event),
error: Some(error),
server: None,
}),
Expand Down Expand Up @@ -120,7 +120,7 @@ impl Operator {
match outcome {
Ok(()) => Ok(BackendSyncResult {
success: true,
event,
event: Some(event),
error: None,
server: None,
}),
Expand Down
34 changes: 34 additions & 0 deletions rust/crates/adc-backend-apisix-standalone/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "adc-backend-apisix-standalone"
version.workspace = true
edition.workspace = true
publish.workspace = true
rust-version.workspace = true

[features]
# Exposes `adc_backend_apisix_standalone::tests`, the internal building
# blocks this crate's own `tests/*.rs` integration tests reach into — never
# meant to be enabled by a real consumer. Off by default so it doesn't leak
# into the crate's normal public API surface; the dev-dependency below turns
# it back on for the crate's own test builds.
test-utils = []

[dependencies]
adc-sdk = { path = "../adc-sdk" }
adc-backend-core = { path = "../adc-backend-core" }
adc-backend-apisix = { path = "../adc-backend-apisix" }
async-trait = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
semver = { workspace = true }
sha1 = { workspace = true }
dashmap = "6"
indexmap = "2"
tokio = { workspace = true, features = ["macros", "sync"] }
log = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
adc-backend-apisix-standalone = { path = ".", features = ["test-utils"] }
adc-differ = { path = "../adc-differ" }
tokio = { workspace = true, features = ["rt-multi-thread", "macros", "time", "process"] }
Loading