Skip to content

[refactor]: fix pytests #1

[refactor]: fix pytests

[refactor]: fix pytests #1

name: I2::Release::Tests
on:
pull_request:
branches: [ iroha2-stable, iroha2-lts ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"
ALLURE_RESULTS: "${{ github.workspace }}/allure-results"
ALLURE_JOB_RUN_ID: ${{ github.event.inputs.ALLURE_JOB_RUN_ID }}
jobs:
client-cli-tests:
runs-on: [self-hosted, Linux, iroha2ci]
container:
image: hyperledger/iroha2-ci:nightly-2024-01-12
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install and configure allurectl
uses: allure-framework/setup-allurectl@v1
with:
allure-endpoint: https://soramitsu.testops.cloud
allure-token: ${{ secrets.ALLURE_TOKEN }}
allure-project-id: 1
- name: Build binaries
run: |
cargo build --bin iroha_client_cli
cargo build --bin kagami
cargo build --bin iroha

Check failure on line 36 in .github/workflows/iroha2-release-pr.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/iroha2-release-pr.yml

Invalid workflow file

You have an error in your yaml syntax on line 36
- name: Setup test Iroha 2 environment on bare metal
run: |
# TODO
# pip3 install -r scripts/requirements.txt --no-input
./scripts/test_env.py setup
- name: Mark binaries as executable
run: |
chmod +x ${{ env.CLIENT_CLI_DIR }}
- name: Install dependencies using Poetry
working-directory: client_cli/pytests
run: |
poetry install
- name: Run client cli tests and upload results to Allure Test Ops
working-directory: client_cli/pytests
run: |
allurectl watch -- poetry run pytest --alluredir=${ALLURE_RESULTS}
printenv | grep GITHUB_TESTS_
env:
GITHUB_TESTS_REF_NAME: ${{ github.ref_name }}
- name: Cleanup test environment
run: |
./scripts/test_env.py cleanup
- name: Panic on invalid genesis test
run: bash -c './scripts/tests/panic_on_invalid_genesis.sh'
bench:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2024-01-12
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Run benchmarks
run: mold --run cargo bench --workspace --quiet
# ------------------------------ SDK tests go here ------------------------
java-api:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2024-01-12
steps:
- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '11'
distribution: 'temurin'
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build iroha
working-directory: cli
run: mold --run cargo build
- name: Build iroha_client_cli
working-directory: client_cli
run: mold --run cargo build
- name: Build kagami
working-directory: tools/kagami
run: mold --run cargo build
- name: Mark binaries as executable
run: |
chmod +x target/debug/iroha
chmod +x target/debug/iroha_client_cli
chmod +x target/debug/kagami
- name: Setup test environment
run: ./scripts/test_env.sh setup
- name: Test iroha2-java API
run: ./scripts/API/java.sh setup && ./scripts/API/java.sh run
- name: Cleanup test iroha2-java API
run: ./scripts/API/java.sh cleanup
- name: Cleanup test environment
run: ./scripts/test_env.sh cleanup
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't
# cached by GitHub Actions. Restoring these files from a
# GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
long:
runs-on: ubuntu-latest #[self-hosted, Linux]
container:
image: hyperledger/iroha2-ci:nightly-2024-01-12
steps:
- name: Maximize build space
uses: jlumbroso/[email protected]
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: false
swap-storage: true
- uses: actions/checkout@v4
- name: Run long tests
run: mold --run cargo test --workspace --no-fail-fast -- --ignored --test-threads=1 long