Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
wirednkod committed Sep 27, 2023
2 parents 59dd23f + 656f56c commit 1e08cb6
Show file tree
Hide file tree
Showing 33 changed files with 4,032 additions and 1,268 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ jobs:
- name: Build
run: cargo build

- name: Tests
run: cargo test
- name: Tests (except provider crate)
run: cargo test --workspace --exclude provider

- name: Tests (provider crate)
# there should be a unique test thread for native provider tests (asserting spawned processes count)
run: cargo test -p provider -- --test-threads 1

coverage:
name: Zombienet SDK - coverage
Expand All @@ -60,7 +64,8 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov

- name: Collect coverage data
run: cargo llvm-cov nextest --lcov --output-path lcov.info
# there should be a unique test thread for native provider tests (asserting spawned processes count)
run: cargo llvm-cov nextest -j 1 --lcov --output-path lcov.info

- name: Report code coverage
uses: Nef10/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ jobs:
cargo doc --no-deps
echo "<meta http-equiv=\"refresh\" content=\"0; url=configuration\">" > target/doc/index.html
- name: Move docs
run: |
mkdir -p ./doc
mv ./target/doc/* ./doc
git config user.email "[email protected]"
git config user.name "GitHub Action"
git config user.password ${{ secrets.GH_PAGES_TOKEN }}
git config user.password "${{ secrets.GH_PAGES_TOKEN }}"
git checkout --orphan gh-pages
mkdir to_delete
shopt -s extglob
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ regex = "1.8"
lazy_static = "1.4"
multiaddr = "0.18"
url = "2.3"
uuid = "1.4"
nix = "0.27"
procfs = "0.15"
2 changes: 1 addition & 1 deletion crates/configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
regex = { workspace = true }
lazy_static = { workspace = true }
multiaddr = { workspace = true }
url = { workspace = true }
url = { workspace = true, features = ["serde"] }
thiserror = { workspace = true }
anyhow = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand Down
7 changes: 3 additions & 4 deletions crates/configuration/src/global_settings.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{error::Error, fmt::Display, net::IpAddr, str::FromStr};

use multiaddr::Multiaddr;
use serde::Serialize;
use serde::{Deserialize, Serialize};

use crate::shared::{
errors::{ConfigError, FieldError},
Expand All @@ -10,9 +10,9 @@ use crate::shared::{
};

/// Global settings applied to an entire network.
#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GlobalSettings {
#[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
#[serde(skip_serializing_if = "std::vec::Vec::is_empty", default)]
bootnodes_addresses: Vec<Multiaddr>,
// TODO: parse both case in zombienet node version to avoid renamed ?
#[serde(rename = "timeout")]
Expand Down Expand Up @@ -44,7 +44,6 @@ impl GlobalSettings {
}

/// A global settings builder, used to build [`GlobalSettings`] declaratively with fields validation.
#[derive(Debug)]
pub struct GlobalSettingsBuilder {
config: GlobalSettings,
errors: Vec<anyhow::Error>,
Expand Down
5 changes: 2 additions & 3 deletions crates/configuration/src/hrmp_channel.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::marker::PhantomData;

use serde::Serialize;
use serde::{Deserialize, Serialize};

use crate::shared::{macros::states, types::ParaId};

/// HRMP channel configuration, with fine-grained configuration options.
#[derive(Debug, Clone, PartialEq, Serialize)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HrmpChannelConfig {
sender: ParaId,
recipient: ParaId,
Expand Down Expand Up @@ -42,7 +42,6 @@ states! {
}

/// HRMP channel configuration builder, used to build an [`HrmpChannelConfig`] declaratively with fields validation.
#[derive(Debug)]
pub struct HrmpChannelConfigBuilder<State> {
config: HrmpChannelConfig,
_state: PhantomData<State>,
Expand Down
3 changes: 3 additions & 0 deletions crates/configuration/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::expect_fun_call)]
mod global_settings;
mod hrmp_channel;
mod network;
Expand All @@ -11,3 +12,5 @@ pub use hrmp_channel::{HrmpChannelConfig, HrmpChannelConfigBuilder};
pub use network::{NetworkConfig, NetworkConfigBuilder};
pub use parachain::{ParachainConfig, ParachainConfigBuilder};
pub use relaychain::{RelaychainConfig, RelaychainConfigBuilder};
// re-export shared
pub use shared::{node::NodeConfig, types};
Loading

0 comments on commit 1e08cb6

Please sign in to comment.