Skip to content

Commit

Permalink
ci(graphql): tests for staging variant (#19371)
Browse files Browse the repository at this point in the history
## Description

Set-up testing for `staging` variant of `sui-graphql-rpc`:

- Split E2E tests into `stable` and `staging` variants (each in their
own sub-directories -- existing tests are all `stable`). Only run the
stable tests by default, and additionally run the staging tests if the
`staging` feature is enabled.
- Generate a separate `staging` schema and snapshot test.
- Add a CI step to run GraphQL tests with the staging flag enabled.

## Test plan

```
sui$ cargo nextest run --profile ci --features staging  \
  -E 'package(sui-graphql-rpc)'                         \
  -E 'package(sui-graphql-e2e-tests)'
```

And also check CI.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [x] GraphQL: Introduce `staging.graphql`. This schema includes changes
that are being developed and tested but have not been productionised
yet.
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
amnn committed Sep 17, 2024
1 parent a725da9 commit 6395d53
Show file tree
Hide file tree
Showing 181 changed files with 9,549 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ jobs:
- name: cargo test
run: |
cargo nextest run --profile ci -E '!package(sui-bridge)'
- name: cargo test (sui-graphql staging)
run: |
cargo nextest run --profile ci --features staging -E 'package(sui-graphql-rpc)' -E 'package(sui-graphql-e2e-tests)'
# Ensure there are no uncommitted changes in the repo after running tests
- run: scripts/changed-files.sh
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-graphql-e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ harness = false

[target.'cfg(msim)'.dependencies]
msim.workspace = true

[features]
staging = ["sui-graphql-rpc/staging"]
11 changes: 9 additions & 2 deletions crates/sui-graphql-e2e-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ use sui_transactional_test_runner::{
run_test_impl,
test_adapter::{SuiTestAdapter, PRE_COMPILED},
};
pub const TEST_DIR: &str = "tests";

datatest_stable::harness!(run_test, TEST_DIR, r".*\.(mvir|move)$");
datatest_stable::harness!(
run_test,
"tests",
if cfg!(feature = "staging") {
r"\.move$"
} else {
r"stable/.*\.move$"
}
);

#[cfg_attr(not(msim), tokio::main)]
#[cfg_attr(msim, msim::main)]
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-graphql-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ sui-framework.workspace = true
tower.workspace = true
sui-test-transaction-builder.workspace = true
sui-move-build.workspace = true

[features]
staging = []
Loading

0 comments on commit 6395d53

Please sign in to comment.