Skip to content

Commit

Permalink
indexer, graphql: remove pg_integration feature flag usage (MystenLab…
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill authored Sep 11, 2024
1 parent 79e76da commit 5415bb6
Show file tree
Hide file tree
Showing 17 changed files with 1,528 additions and 1,580 deletions.
22 changes: 2 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ jobs:
with:
ref: ${{ github.event.inputs.sui_repo_ref || github.ref }}
- uses: taiki-e/install-action@nextest
- name: Add postgres to PATH
run: echo "/usr/lib/postgresql/14/bin" >> $GITHUB_PATH
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand Down Expand Up @@ -401,23 +403,3 @@ jobs:
run: ./scripts/execution_layer.py cut for_ci_test
- name: Check execution builds
run: cargo build -p sui-execution

graphql-rpc:
name: graphql-rpc
needs: diff
if: needs.diff.outputs.isRust == 'true'
timeout-minutes: 45
runs-on: [ ubuntu-ghcloud ]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # Pin v4.1.1
with:
ref: ${{ github.event.inputs.sui_repo_ref || github.ref }}
- uses: taiki-e/install-action@nextest
- name: Add postgres to PATH
run: echo "/usr/lib/postgresql/14/bin" >> $GITHUB_PATH
- name: tests-requiring-postgres
run: |
# The tests in these packages have been converted to use a temporary, ephemoral postgres database and so can be run in parallel
cargo nextest run --profile ci --package sui-indexer --package sui-graphql-e2e-tests --package sui-cluster-test --package sui-graphql-rpc --features pg_integration
4 changes: 0 additions & 4 deletions crates/sui-cluster-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,3 @@ telemetry-subscribers.workspace = true

test-cluster.workspace = true
move-core-types.workspace = true

[features]
default = []
pg_integration = []
1 change: 0 additions & 1 deletion crates/sui-cluster-test/tests/local_cluster_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ async fn cluster_test() {
ClusterTest::run(ClusterTestOpt::new_local()).await;
}

#[cfg(feature = "pg_integration")]
#[tokio::test]
async fn test_sui_cluster() {
use reqwest::StatusCode;
Expand Down
5 changes: 0 additions & 5 deletions crates/sui-graphql-e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,5 @@ harness = false

[dependencies]

[features]
default = ["pg_backend"]
pg_integration = []
pg_backend = []

[target.'cfg(msim)'.dependencies]
msim.workspace = true
5 changes: 1 addition & 4 deletions crates/sui-graphql-e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ Linux

# Running Locally

When running the tests locally, they must be run with the `pg_integration`
feature enabled:

```sh
$ cargo nextest run --features pg_integration
$ cargo nextest run
```

# Snapshot Stability
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-graphql-e2e-tests/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ datatest_stable::harness!(run_test, TEST_DIR, r".*\.(mvir|move)$");
#[cfg_attr(msim, msim::main)]
async fn run_test(path: &Path) -> Result<(), Box<dyn std::error::Error>> {
telemetry_subscribers::init_for_testing();
if cfg!(feature = "pg_integration") {
if !cfg!(msim) {
run_test_impl::<SuiTestAdapter>(path, Some(Arc::new(PRE_COMPILED.clone()))).await?;
}
Ok(())
Expand Down
4 changes: 0 additions & 4 deletions crates/sui-graphql-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,3 @@ sui-framework.workspace = true
tower.workspace = true
sui-test-transaction-builder.workspace = true
sui-move-build.workspace = true

[features]
default = []
pg_integration = []
2 changes: 1 addition & 1 deletion crates/sui-graphql-rpc/src/data/pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ mod query_cost {
}
}

#[cfg(all(test, feature = "pg_integration"))]
#[cfg(test)]
mod tests {
use super::*;
use diesel::QueryDsl;
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-graphql-rpc/src/server/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl ServerBuilder {
self
}

#[cfg(all(test, feature = "pg_integration"))]
#[cfg(test)]
fn build_schema(self) -> Schema<Query, Mutation, EmptySubscription> {
self.schema.finish()
}
Expand Down Expand Up @@ -678,7 +678,7 @@ async fn get_or_init_server_start_time() -> &'static Instant {
ONCE.get_or_init(|| async move { Instant::now() }).await
}

#[cfg(all(test, feature = "pg_integration"))]
#[cfg(test)]
pub mod tests {
use super::*;
use crate::test_infra::cluster::{prep_executor_cluster, start_cluster};
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-graphql-rpc/src/test_infra/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ use tokio::task::JoinHandle;
use tokio_util::sync::CancellationToken;
use tracing::info;

const VALIDATOR_COUNT: usize = 7;
const EPOCH_DURATION_MS: u64 = 15000;
const VALIDATOR_COUNT: usize = 4;
const EPOCH_DURATION_MS: u64 = 10000;

const ACCOUNT_NUM: usize = 20;
const GAS_OBJECT_COUNT: usize = 3;
Expand Down
Loading

0 comments on commit 5415bb6

Please sign in to comment.