Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
chore: add suite of qa tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashad Alston authored and Rashad Alston committed Sep 18, 2023
1 parent 1b345b0 commit 4682e82
Show file tree
Hide file tree
Showing 10 changed files with 621 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ docs/book/
# There's not really a great way to cleanup the test manifest assets
# used by the trybuild tests, and we don't want to commit these test
# files so as to not clutter the repo. So, we'll just ignore them.
packages/fuel-indexer-tests/trybuild/*.yaml
packages/fuel-indexer-tests/trybuild/*.yaml

8 changes: 8 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion packages/fuel-indexer-api-server/src/uses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub(crate) async fn remove_indexer(
// unnecessary DatabaseError's appearing in the logs.
tokio::time::sleep(std::time::Duration::from_secs(1)).await;

// Allways remove data when removing an indexer.
// Always remove data when removing an indexer.
if let Err(e) =
queries::remove_indexer(&mut conn, &namespace, &identifier, true).await
{
Expand Down
12 changes: 12 additions & 0 deletions packages/fuel-indexer-benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ name = "wasm"
name = "fuel_indexer_benchmarks"
crate-type = ["cdylib", "rlib"]

[[bin]]
name = "qa"
path = "src/bin/qa.rs"

[dependencies]
chrono = { version = "0.4", features = ["serde"] }
clap = { workspace = true }
criterion = { version = "0.5.1", features = ["html_reports", "async_tokio"] }
duct = "0.13"
fuel-core-client = "0.20"
fuel-indexer = { workspace = true }
fuel-indexer-database = { workspace = true }
Expand All @@ -27,4 +34,9 @@ fuel-indexer-lib = { workspace = true }
fuel-indexer-schema = { workspace = true }
fuel-indexer-tests = { path = "../fuel-indexer-tests" }
futures = "0.3"
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls", "multipart", "stream"] }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tracing = { workspace = true }
tracing-subscriber = { version = "0.2", features = ["env-filter"] }
8 changes: 8 additions & 0 deletions packages/fuel-indexer-benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ in the `/scripts/utils` folder of the repo root.

## Usage

### `criterion` benchmarking

Ensure that you are in the `fuel-indexer-benchmarks` directory and then run `cargo bench`. The
compile time for benchmarks is a bit longer than that of normal compilation, so it may take longer
than one would expect. Eventually, timings will be logged to the terminal, showing you the minimum,
average, and maximum times for each benchmark; they will also be saved for comparison against future
runs in `target/criterion`. Additionally, an HTML file with plots and statistics can be found at
`target/criterion/report/index.html`.

### QA suite

```bash
cargo run -p fuel-indexer-benchmarks --bin qa -- --network beta-4.fuel.network
```

### Comparing Branches

You can compare branches by switching to the base branch, running `cargo bench`, then switching to your
Expand Down
Loading

0 comments on commit 4682e82

Please sign in to comment.