Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
dima74 committed Jun 7, 2024
1 parent 7b6b8cb commit ca983a6
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 106 deletions.
206 changes: 104 additions & 102 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: I2::Dev::Tests

on:
push:
branches: [diralik/custom-isi2]
pull_request:
branches: [main]
paths:
Expand All @@ -20,27 +22,27 @@ env:
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"

jobs:
consistency:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Check genesis.json
if: always()
run: ./scripts/tests/consistency.sh genesis
- name: Check schema.json
if: always()
run: ./scripts/tests/consistency.sh schema
- name: Check Docker Compose configurations
if: always()
run: ./scripts/tests/consistency.sh docker-compose
# consistency:
# runs-on: [self-hosted, Linux, iroha2]
# container:
# image: hyperledger/iroha2-ci:nightly-2024-04-18
# steps:
# - uses: actions/checkout@v4
# - uses: Swatinem/rust-cache@v2
# - name: Check genesis.json
# if: always()
# run: ./scripts/tests/consistency.sh genesis
# - name: Check schema.json
# if: always()
# run: ./scripts/tests/consistency.sh schema
# - name: Check Docker Compose configurations
# if: always()
# run: ./scripts/tests/consistency.sh docker-compose

# include: client/tests/integration/
# exclude: client/tests/integration/extra_functional
integration:
runs-on: [self-hosted, Linux, iroha2]
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 30
Expand All @@ -50,89 +52,89 @@ jobs:
- name: Run tests, with no-default-features
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha integration -- --skip extra_functional

# include: client/tests/integration/extra_functional
extra_functional:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional

# Run the job to check that the docker containers are properly buildable
pr-generator-build:
# Job will only execute if the head of the pull request is a branch for PR-generator case
if: startsWith(github.head_ref, 'iroha2-pr-deploy/')
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
- name: Login to Soramitsu Harbor
uses: docker/login-action@v3
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Build and push iroha2:dev image
uses: docker/build-push-action@v4
if: always()
with:
push: true
tags: docker.soramitsu.co.jp/iroha2/iroha2:dev-${{ github.event.pull_request.head.sha }}
labels: commit=${{ github.sha }}
build-args: TAG=dev
file: Dockerfile
# This context specification is required
context: .
# # include: client/tests/integration/extra_functional
# extra_functional:
# runs-on: [self-hosted, Linux, iroha2]
# container:
# image: hyperledger/iroha2-ci:nightly-2024-04-18
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v4
# - uses: Swatinem/rust-cache@v2
# - name: Run tests
# run: mold --run cargo test --no-default-features --no-fail-fast -p iroha extra_functional

torii-api-and-client-cli-tests:
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Build binaries
run: |
cargo build -p iroha_client_cli -p kagami -p irohad
- name: Setup test Iroha 2 environment on the bare metal
run: |
pip3 install -r scripts/requirements.txt --no-input --break-system-packages
./scripts/test_env.py setup
- name: Mark binaries as executable
run: |
chmod +x ${{ env.CLIENT_CLI_DIR }}
- name: Install torii api dependencies using Poetry
working-directory: torii/pytests
run: |
poetry install
- name: Run torii api tests
working-directory: torii/pytests
run: |
poetry run pytest
- name: Install client cli dependencies using Poetry
working-directory: client_cli/pytests
run: |
poetry install
- name: Run client cli tests
working-directory: client_cli/pytests
env:
# prepared by `test_env.py`
CLIENT_CLI_BINARY: ../../test/iroha
CLIENT_CLI_CONFIG: ../../test/client.toml
run: |
poetry run pytest
- name: Cleanup test environment
run: |
./scripts/test_env.py cleanup
# # Run the job to check that the docker containers are properly buildable
# pr-generator-build:
# # Job will only execute if the head of the pull request is a branch for PR-generator case
# if: startsWith(github.head_ref, 'iroha2-pr-deploy/')
# runs-on: [self-hosted, Linux, iroha2]
# container:
# image: hyperledger/iroha2-ci:nightly-2024-04-18
# steps:
# - uses: actions/checkout@v4
# - name: Login to Soramitsu Harbor
# uses: docker/login-action@v3
# with:
# registry: docker.soramitsu.co.jp
# username: ${{ secrets.HARBOR_USERNAME }}
# password: ${{ secrets.HARBOR_TOKEN }}
# - name: Set up Docker Buildx
# id: buildx
# if: always()
# uses: docker/setup-buildx-action@v2
# with:
# install: true
# - name: Build and push iroha2:dev image
# uses: docker/build-push-action@v4
# if: always()
# with:
# push: true
# tags: docker.soramitsu.co.jp/iroha2/iroha2:dev-${{ github.event.pull_request.head.sha }}
# labels: commit=${{ github.sha }}
# build-args: TAG=dev
# file: Dockerfile
# # This context specification is required
# context: .
#
# torii-api-and-client-cli-tests:
# runs-on: [self-hosted, Linux, iroha2]
# container:
# image: hyperledger/iroha2-ci:nightly-2024-04-18
# timeout-minutes: 60
# steps:
# - uses: actions/checkout@v4
# - uses: Swatinem/rust-cache@v2
# - name: Build binaries
# run: |
# cargo build -p iroha_client_cli -p kagami -p irohad
# - name: Setup test Iroha 2 environment on the bare metal
# run: |
# pip3 install -r scripts/requirements.txt --no-input --break-system-packages
# ./scripts/test_env.py setup
# - name: Mark binaries as executable
# run: |
# chmod +x ${{ env.CLIENT_CLI_DIR }}
# - name: Install torii api dependencies using Poetry
# working-directory: torii/pytests
# run: |
# poetry install
# - name: Run torii api tests
# working-directory: torii/pytests
# run: |
# poetry run pytest
# - name: Install client cli dependencies using Poetry
# working-directory: client_cli/pytests
# run: |
# poetry install
# - name: Run client cli tests
# working-directory: client_cli/pytests
# env:
# # prepared by `test_env.py`
# CLIENT_CLI_BINARY: ../../test/iroha
# CLIENT_CLI_CONFIG: ../../test/client.toml
# run: |
# poetry run pytest
# - name: Cleanup test environment
# run: |
# ./scripts/test_env.py cleanup
8 changes: 4 additions & 4 deletions client/tests/integration/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ fn executor_upgrade_should_revoke_removed_permissions() -> Result<()> {
fn executor_custom_instructions_simple() -> Result<()> {
use executor_custom_data_model::simple::{CustomInstructionBox, MintAssetForAllAccounts};

let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_170).start_with_runtime();
let (_rt, _peer, client) = <PeerBuilder>::new().with_port(11_270).start_with_runtime();
wait_for_genesis_committed(&vec![client.clone()], 0);

upgrade_executor(
Expand Down Expand Up @@ -252,11 +252,11 @@ fn executor_custom_instructions_complex() -> Result<()> {
config.chain_wide.executor_runtime.fuel_limit = 1_000_000_000;

// This is attempt to make test not flaky (it passes locally but fails on CI)
config.network.idle_timeout = Duration::from_secs(3600);
config.live_query_store.idle_time = Duration::from_secs(3600);
// config.network.idle_timeout = Duration::from_secs(3600);
// config.live_query_store.idle_time = Duration::from_secs(3600);

let (_rt, _peer, client) = PeerBuilder::new()
.with_port(11_185)
.with_port(11_275)
.with_config(config)
.start_with_runtime();
wait_for_genesis_committed(&vec![client.clone()], 0);
Expand Down

0 comments on commit ca983a6

Please sign in to comment.