Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/run-e2e-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ runs:
- name: Run finalization e2e test
if: inputs.follow-up-finalization-check == 'true'
shell: bash
run: ./.github/scripts/run_e2e_test.sh -t finalization -m "${{ inputs.min-validator-count }}"
run: ./.github/scripts/run_e2e_test.sh -t finalization::finalization -m "${{ inputs.min-validator-count }}"
18 changes: 9 additions & 9 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ jobs:
- name: Build binary and docker image
run: |
cd e2e-tests/
cargo build --release
rm -f target/release/deps/aleph_e2e_client*
cp $(cargo test --no-run --release --message-format=json | jq -r .executable | grep aleph_e2e_client) target/release/aleph-e2e-client
docker build --tag aleph-e2e-client:latest -f Dockerfile .
docker save -o aleph-e2e-client.tar aleph-e2e-client:latest

Expand All @@ -192,7 +193,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: finalization
test-case: finalization::finalization
timeout-minutes: 2


Expand All @@ -207,7 +208,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: rewards_disable_node
test-case: rewards::disable_node
follow-up-finalization-check: true
timeout-minutes: 15

Expand Down Expand Up @@ -360,7 +361,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: era_payout
test-case: era_payout::era_payout
follow-up-finalization-check: true
timeout-minutes: 10

Expand Down Expand Up @@ -390,7 +391,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: rewards_force_new_era
test-case: rewards::force_new_era
follow-up-finalization-check: true
timeout-minutes: 10

Expand All @@ -405,7 +406,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: rewards_stake_change
test-case: rewards::points_stake_change
follow-up-finalization-check: true
timeout-minutes: 10

Expand All @@ -420,7 +421,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: rewards_change_stake_and_force_new_era
test-case: rewards::change_stake_and_force_new_era
follow-up-finalization-check: true
timeout-minutes: 10

Expand Down Expand Up @@ -528,7 +529,7 @@ jobs:
- name: Run e2e test
uses: ./.github/actions/run-e2e-test
with:
test-case: version_upgrade
test-case: version_upgrade::schedule_version_change
env:
UPGRADE_VERSION: 1
UPGRADE_SESSION: 3
Expand Down Expand Up @@ -556,7 +557,6 @@ jobs:
# UPGRADE_FINALIZATION_WAIT_SESSIONS: 2
# ONLY_LEGACY: true
# timeout-minutes: 10

# run-e2e-version-upgrade-catchup:
# needs: [build-test-docker, build-cliain-image]
# name: Run series of tests where some of the nodes need to do version-upgrade during catch-up
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nightly-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ jobs:
- name: Build binary and docker image
run: |
cd e2e-tests/
cargo build --release
rm -f target/release/deps/aleph_e2e_client*
cp $(cargo test --no-run --release --message-format=json | jq -r .executable | grep aleph_e2e_client) target/release/aleph-e2e-client
docker build --tag aleph-e2e-client:latest -f Dockerfile .
docker save -o aleph-e2e-client.tar aleph-e2e-client:latest

Expand Down
2 changes: 2 additions & 0 deletions e2e-tests/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
!target/release/aleph-e2e-client
2 changes: 2 additions & 0 deletions e2e-tests/Cargo.lock

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

1 change: 1 addition & 0 deletions e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ codec = { package = 'parity-scale-codec', version = "3.0", default-features = fa
rayon = "1.5"
tokio = { version = "1.21.2", features = ["full"] }
futures = "0.3.25"
once_cell = "1.16"

sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.30", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.30", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/docker_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ if [[ -n "${UPGRADE_VERSION:-}" && -n "${UPGRADE_SESSION:-}" && -n "${UPGRADE_FI
)
fi

aleph-e2e-client "${ARGS[@]}"
E2E_CONFIG="${ARGS[*]}" aleph-e2e-client $TEST_CASES --nocapture

echo "Done!"
4 changes: 2 additions & 2 deletions e2e-tests/src/ban.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use primitives::{SessionCount, SessionIndex};
use sp_runtime::Perbill;

use crate::{
accounts::account_ids_from_keys, elections::get_members_subset_for_session,
validators::get_test_validators, Config,
accounts::account_ids_from_keys, config::Config, elections::get_members_subset_for_session,
validators::get_test_validators,
};

const RESERVED_SEATS: u32 = 2;
Expand Down
90 changes: 0 additions & 90 deletions e2e-tests/src/cases.rs

This file was deleted.

14 changes: 14 additions & 0 deletions e2e-tests/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
use std::env;

use aleph_client::{RootConnection, SignedConnection};
use clap::{Args, Parser};
use once_cell::sync::Lazy;
use primitives::SessionIndex;

use crate::accounts::{get_sudo_key, get_validators_keys, get_validators_seeds, NodeKeys};

static GLOBAL_CONFIG: Lazy<Config> = Lazy::new(|| {
let unparsed = env::var("E2E_CONFIG").unwrap_or("".to_string());
let unparsed = format!("e2e {}", unparsed);
Config::parse_from(unparsed.split_whitespace())
});

pub fn setup_test() -> &'static Config {
let _ = env_logger::builder().is_test(true).try_init();
&GLOBAL_CONFIG
}

#[derive(Debug, Parser, Clone)]
#[clap(version = "1.0")]
pub struct Config {
Expand Down
12 changes: 8 additions & 4 deletions e2e-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
pub use cases::{run_all_testcases, run_testcase};
pub use config::Config;

#[cfg(test)]
mod accounts;
#[cfg(test)]
mod ban;
mod cases;
#[cfg(test)]
mod config;
#[cfg(test)]
mod elections;
#[cfg(test)]
mod rewards;
#[cfg(test)]
mod test;
#[cfg(test)]
mod transfer;
#[cfg(test)]
mod validators;
52 changes: 0 additions & 52 deletions e2e-tests/src/main.rs

This file was deleted.

6 changes: 4 additions & 2 deletions e2e-tests/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use sp_runtime::Perquintill;

use crate::{
accounts::{get_validators_keys, get_validators_seeds, NodeKeys},
Config,
config::Config,
};

const COMMITTEE_SEATS: CommitteeSeats = CommitteeSeats {
Expand Down Expand Up @@ -51,7 +51,9 @@ pub async fn set_invalid_keys_for_validator(
}

/// Rotates session_keys of a given `controller`, making it able to rejoin the `consensus`.
pub async fn reset_validator_keys(controller_connection: &SignedConnection) -> anyhow::Result<()> {
pub(super) async fn reset_validator_keys(
controller_connection: &SignedConnection,
) -> anyhow::Result<()> {
let validator_keys = controller_connection.connection.author_rotate_keys().await;
controller_connection
.set_keys(validator_keys, TxStatus::InBlock)
Expand Down
Loading