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: [api, config, controller, impls, libwallet, .]
job_args: [api, config, controller, impls, libwallet, integration, .]
steps:
- uses: actions/checkout@v3
- name: Test ${{ matrix.job_args }}
working-directory: ${{ matrix.job_args }}
run: cargo test --release
# Multi-process node+wallet tests need serial execution (ports / RocksDB).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grin uses LMDB here, not RocksDB, and the same wording also appears in the README. Could we simply say “fixed ports and data directories” instead?

Grin++ use RocksDB

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
62 changes: 62 additions & 0 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ name = "grin-wallet"
path = "src/bin/grin-wallet.rs"

[workspace]
members = ["api", "config", "controller", "impls", "libwallet", "util"]
exclude = ["integration"]
members = ["api", "config", "controller", "impls", "libwallet", "util", "integration"]

[dependencies]
clap = { version = "2.33", features = ["yaml"] }
Expand Down
46 changes: 18 additions & 28 deletions integration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
[package]
name = "grin_integration"
version = "1.1.0"
name = "grin_wallet_integration"
version = "5.4.1"
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
description = "Simple, private and scalable cryptocurrency implementation based on the MimbleWimble chain format."
description = "Node + wallet multi-process integration tests for grin-wallet"
license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
repository = "https://github.com/mimblewimble/grin-wallet"
keywords = ["crypto", "grin", "mimblewimble"]
workspace = ".."
edition = "2021"
publish = false

[dependencies]
hyper = "0.12"
futures = "0.1"
http = "0.1"
itertools = "0.7"
rand = "0.5"
serde = "1"
futures = "0.3"
log = "0.4"
serde_derive = "1"
serde_json = "1"
chrono = "0.4.4"
tokio = "0.1.11"
blake2-rfc = "0.2"
bufstream = "0.1"

#grin_apiwallet = { path = "../apiwallet", version = "1.1.0" }
#grin_libwallet = { path = "../libwallet", version = "1.1.0" }
#grin_refwallet = { path = "../refwallet", version = "1.1.0" }
#grin_wallet_config = { path = "../config", version = "1.1.0" }
grin_wallet_config = { path = "../config", version = "5.4.1" }
grin_wallet_controller = { path = "../controller", version = "5.4.1" }
grin_wallet_impls = { path = "../impls", version = "5.4.1" }
grin_wallet_libwallet = { path = "../libwallet", version = "5.4.1" }

#grin_core = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_keychain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_chain = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_util = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_api = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_store = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_p2p = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
#grin_servers = { git = "https://github.com/mimblewimble/grin", branch = "milestone/1.1.0" }
# Align with workspace grin crates (node multi-server stack).
grin_core = "5.4.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration crate still pulls the node crates from crates.io, while staging now uses the pinned grin submodule. In a local merge this resolved two different Grin stacks, and the test build then failed against the current APIs. Could we use the same path dependencies as staging here?

grin_keychain = "5.4.1"
grin_util = "5.4.1"
grin_api = "5.4.1"
grin_p2p = "5.4.1"
grin_servers = "5.4.1"
20 changes: 20 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Wallet + node integration tests

Multi-process tests that run a real Grin node (`grin_servers`) together with

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests run as threads inside one process, and the owner HTTP listener is currently not used at all. Could we describe this as live node-and-wallet integration with foreign HTTP, or actually add the missing owner and multi-process coverage?

`grin-wallet` foreign/owner HTTP listeners.

**Node-only** multi-server suites (seeding, propagation, body sync, stratum)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The revived node suites are currently still part of the open mimblewimble/grin #3910 PR and do not live in grin yet. Could we link the open PR and phrase this accordingly until it is merged?

live in [mimblewimble/grin](https://github.com/mimblewimble/grin) under
`integration/` ([#2957](https://github.com/mimblewimble/grin/issues/2957)).

In-process wallet unit/integration coverage (mock node via `WalletProxy`)
remains under `controller/tests/`.

## Run

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

Serial execution avoids port and RocksDB races.
12 changes: 5 additions & 7 deletions integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//! Grin integration test crate

#![deny(non_upper_case_globals)]
#![deny(non_camel_case_types)]
#![deny(non_snake_case)]
#![deny(unused_mut)]
#![warn(missing_docs)]
//! Node + wallet multi-process integration tests.
//!
//! Node-only multi-server coverage lives in the [grin](https://github.com/mimblewimble/grin)
//! `integration` crate ([#2957](https://github.com/mimblewimble/grin/issues/2957)).
//! This crate exercises wallet listeners against a real `grin_servers` node.
Loading
Loading