Skip to content

Commit

Permalink
Merge branch 'main' into just-rmt-sig
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Nov 4, 2024
2 parents 149e643 + e77803e commit 81f5d30
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#zome_call_single_value -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -93,7 +93,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -103,7 +103,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -113,7 +113,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#app_install -- --connection-string ws://localhost:8888 --agents 2 --behaviour minimal:1 --behaviour large:1 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -123,7 +123,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#first_call -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -133,7 +133,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#write_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -143,7 +143,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#write_query -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -153,7 +153,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#local_signals -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -163,7 +163,7 @@ jobs:
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
# Run the scenario for 5 seconds
# Run the scenario
RUST_LOG=info nix run .#write_validated -- --connection-string ws://localhost:8888 --duration 5 --no-progress
pkill hc && pkill holochain && pkill lair-keystore
Expand All @@ -177,7 +177,7 @@ jobs:
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
# Run the scenario
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#trycp_write_validated -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
Expand All @@ -194,8 +194,8 @@ jobs:
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_call_rate -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Run the scenario
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_call_rate -- --targets targets-ci.yaml --instances-per-target 2 --duration 45 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
Expand All @@ -209,7 +209,7 @@ jobs:
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
# Run the scenario
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#two_party_countersigning -- --targets targets-ci.yaml --behaviour initiate:1 --behaviour participate:1 --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
Expand All @@ -226,8 +226,8 @@ jobs:
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#validation_receipts -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Run the scenario
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#validation_receipts -- --targets targets-ci.yaml --instances-per-target 2 --duration 45 --no-progress
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
Expand All @@ -243,7 +243,7 @@ jobs:
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
# Run the scenario for 30 seconds
# Run the scenario
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#remote_signals -- --targets targets-ci.yaml --instances-per-target 2 --duration 30 --no-progress
# Stop the TryCP instance
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
we will separate those parts out and publish them as a crate. For now, this is private to the project.
- `run_with_required_agents` function for TryCP scenarios that fails if the number of agents that completed the scenario
is less than the passed `min_required_agents`. Can be overridden with the `MIN_REQUIRED_AGENTS` environment variable.
- Check that the scenarios have a cargo package name that matches the directory name used by Nix packages. Panic when
building the scenario if they do not match. [#122](https://github.com/holochain/wind-tunnel/pull/122)

### Changed
- Updated to new Holochain client version 0.5.0-alpha.4 which allowed `&mut self` to be replaced with `&self` in admin
Expand Down
2 changes: 1 addition & 1 deletion nix/modules/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let

rustWithWasmTarget = rustPkgs.rust-bin.stable."${rustVersion}".minimal.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "clippy" ];
extensions = [ "clippy" "rustfmt" ];
};

craneLib = (crane.mkLib rustPkgs).overrideToolchain rustWithWasmTarget;
Expand Down
15 changes: 14 additions & 1 deletion scenarios/scenario_build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
use happ_builder::{build_happs, required_tools_available, BuildOptions, HappBuilderResult};
use std::{path::PathBuf, str::FromStr};

/// Build the required DNA(s) and hApps for the scenario.
/// The built DNA(s) will appear as `/dnas/<scenario-name>/<dna-name>.dna` from the project root.
/// /// The built hApp(s) will appear as `/happs/<scenario-name>/<happ-name>.happ` from the project root.
/// The built hApp(s) will appear as `/happs/<scenario-name>/<happ-name>.happ` from the project root.
fn main() -> HappBuilderResult {
let scenario_dir = PathBuf::from_str(std::env!("CARGO_MANIFEST_DIR")).unwrap();
let dir_name = scenario_dir.file_name().unwrap().to_str().unwrap();
let package_name = std::env!("CARGO_PKG_NAME");
if package_name != dir_name {
// The directory name is used as the Nix package name which is in turn used with `cargo run`
// inside the Nix package. Therefore, panic during the build if the directory name does not
// match the package name.
panic!(
"The package name of the scenario '{package_name}' does not match the directory name '{dir_name}'",
);
}

println!("cargo:rerun-if-env-changed=SKIP_HAPP_BUILD");
if std::env::var("SKIP_HAPP_BUILD").is_ok() {
return Ok(());
Expand Down

0 comments on commit 81f5d30

Please sign in to comment.