Skip to content

Commit

Permalink
Integration tests for onboarding and autopay (#548)
Browse files Browse the repository at this point in the history
* adds autopay, miner, onboard integration tests to ci

* new account.json fixtures.

*  set chain id for swarm cases of onboarding

* change timeout of integration test
  • Loading branch information
0o-de-lally authored Jun 9, 2021
1 parent c3b7c82 commit 06d519c
Show file tree
Hide file tree
Showing 18 changed files with 922 additions and 128 deletions.
59 changes: 11 additions & 48 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
branches: [ main, 'release**' ]

jobs:
mine:
name: Mining
integration:
name: Integration
runs-on: self-hosted
timeout-minutes: 45
timeout-minutes: 90
env:
NODE_ENV: test
TEST: y
Expand All @@ -29,56 +29,19 @@ jobs:
run: sudo apt-get install -y lld
- name: Check branch
run: echo "${{ steps.branch-name.outputs.current_branch }}"
- name: Swarm mining test
- name: Build sdlib
run: cargo r -p stdlib --release
- name: MINING
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-mining.mk test
autopay:
name: Autopay
runs-on: self-hosted
timeout-minutes: 45
env:
NODE_ENV: test
TEST: y
steps:
- uses: actions/checkout@v2
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.46.0
override: true
components: rustfmt, clippy
- name: Install deps
run: sudo apt-get install -y lld
- name: Check branch
run: echo "${{ steps.branch-name.outputs.current_branch }}"
- name: Swarm autopay percent-change
- name: AUTOPAY percent-change
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-autopay.mk test-percent-change
- name: Swarm autopay fixed-once
- name: AUTOPAY fixed-once
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-autopay.mk test-fixed-once
upgrade:
name: Stdlib Upgrade
runs-on: self-hosted
timeout-minutes: 45
steps:
- uses: actions/checkout@v2
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v4
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.46.0
override: true
components: rustfmt, clippy
- name: Install deps
run: sudo apt-get install -y lld
- name: Check branch
run: echo "${{ steps.branch-name.outputs.current_branch }}"
- name: ONBOARD
run: RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-onboard.mk test
- name: File permissions
run: sudo chmod -R 777 language/stdlib/
- name: Swarm upgrade test
- name: UPGRADE
run: BRANCH_NAME=${{ steps.branch-name.outputs.current_branch }} RUSTC_WRAPPER=sccache SOURCE_PATH=./ make -f ol/integration-tests/test-upgrade.mk test


7 changes: 4 additions & 3 deletions ol/cli/src/node/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use anyhow::Error;
use cli::libra_client::LibraClient;
use libra_config::config::NodeConfig;
use libradb::LibraDB;
use std::path::PathBuf;
use std::{process::Command, str};
use sysinfo::SystemExt;
use sysinfo::{ProcessExt, ProcessStatus};
Expand Down Expand Up @@ -74,10 +75,10 @@ impl Node {
}

/// default node connection from configs
pub fn default_from_cfg(mut cfg: AppCfg) -> Node {
pub fn default_from_cfg(mut cfg: AppCfg, swarm_path: Option<PathBuf>) -> Node {
// NOTE: not intended for swarm.
let client = client::pick_client(None, &mut cfg).unwrap();
Node::new(client, cfg, false)
let client = client::pick_client(swarm_path.clone(), &mut cfg).unwrap();
Node::new(client, cfg, swarm_path.is_some())
}


Expand Down
Loading

0 comments on commit 06d519c

Please sign in to comment.