Skip to content
Open
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
10 changes: 8 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
job_args: [servers, chain, core, keychain, pool, p2p, src, api, util, store]
job_args: [servers, chain, core, keychain, pool, p2p, src, api, util, store, integration]
steps:
- uses: actions/checkout@v3
- name: Test ${{ matrix.job_args }}
working-directory: ${{ matrix.job_args }}
run: cargo test --release
# Integration tests open real ports and multi-node clusters; run them serially.
run: |
if [ "${{ matrix.job_args }}" = "integration" ]; then
cargo test --release -- --test-threads=1
else
cargo test --release
fi
macos-tests:
name: macOS Tests
Expand Down
21 changes: 21 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build = "src/build/build.rs"
edition = "2021"

[workspace]
members = ["api", "chain", "config", "core", "keychain", "p2p", "servers", "store", "util", "pool"]
members = ["api", "chain", "config", "core", "keychain", "p2p", "servers", "store", "util", "pool", "integration"]
exclude = ["etc/gen_gen"]

[[bin]]
Expand Down
23 changes: 23 additions & 0 deletions integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "grin_integration"
version = "5.5.1-alpha.0"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Multi-node integration tests for the Grin node"
license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = ["crypto", "grin", "mimblewimble"]
workspace = ".."
edition = "2021"
publish = false

[dependencies]
bufstream = "0.1"
futures = "0.3"
log = "0.4"
serde_json = "1"

grin_api = { path = "../api", version = "5.5.1-alpha.0" }
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
grin_p2p = { path = "../p2p", version = "5.5.1-alpha.0" }
grin_servers = { path = "../servers", version = "5.5.1-alpha.0" }
grin_util = { path = "../util", version = "5.5.1-alpha.0" }
31 changes: 31 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Node integration tests

Multi-node integration coverage for the Grin **node**, re-introduced after the
wallet split ([#2957](https://github.com/mimblewimble/grin/issues/2957)).

These tests do **not** depend on `grin-wallet`. Coinbase is burned via the
internal test miner (`start_test_miner(None, …)`). Wallet-coupled scenarios
(payments, dandelion with wallets, owner/foreign APIs) remain in the
[grin-wallet](https://github.com/mimblewimble/grin-wallet) repository.

## Run

From the repo root or this crate:

```bash
cd integration
cargo test --release -- --test-threads=1
```

Serial execution (`--test-threads=1`) avoids port and RocksDB races between
clusters. CI runs this crate the same way.

## Suites

| File | Coverage |
|------|----------|
| `tests/simulnet.rs` | Mining, seeding, block propagation, full/long body sync |
| `tests/p2p.rs` | Peer connect, ban, unban |
| `tests/stratum.rs` | Live stratum JSON-RPC + job broadcast |

Shared helpers live in `tests/common/`.
19 changes: 19 additions & 0 deletions integration/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2021 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//! Multi-node integration tests for the Grin node.
//!
//! These tests re-introduce node-only coverage that lived in `servers/tests`
//! before the wallet was extracted (see mimblewimble/grin#2957). Wallet-coupled
//! flows remain in the `grin-wallet` repository.
Loading