Skip to content

Commit

Permalink
[ci]: add allure
Browse files Browse the repository at this point in the history
Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 authored and AlexStroke committed Oct 23, 2023
1 parent 188e92e commit 66d64ed
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/iroha2-ci-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: docker/build-push-action@v4
with:
push: true
tags: alexstrokelive/iroha2-ci:pytest-nightly-2023-06-25
tags: hyperledger/iroha2-ci:nightly-2023-06-25
labels: commit=${{ github.sha }}
file: Dockerfile.build
# This context specification is required
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/iroha2-dev-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ concurrency:

env:
CARGO_TERM_COLOR: always
CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test"

jobs:
consistency:
Expand Down Expand Up @@ -131,46 +132,33 @@ jobs:
# This context specification is required
context: .

client-cli-test:
client-cli-tests:
runs-on: [self-hosted, Linux, iroha2ci]
container:
image: alexstrokelive/iroha2-ci:pytest-nightly-2023-06-25
image: hyperledger/iroha2-ci:nightly-2023-06-25
timeout-minutes: 60

steps:

- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2

- name: Build binaries
run: |
cargo build --bin iroha_client_cli
cargo build --bin kagami
cargo build --bin iroha
- name: Setup test Iroha 2 environment on the bare metal
run: |
./scripts/test_env.py setup
- name: Mark binaries as executable
run: |
chmod +x $CLIENT_CLI_DIR
chmod +x ${{ env.CLIENT_CLI_DIR }}
- name: Install dependencies using Poetry
working-directory: client_cli/pytests
run: |
poetry install
- name: Run client cli tests
working-directory: client_cli/pytests
run: |
poetry run pytest
- name: Cleanup test environment
run: |
./scripts/test_env.py cleanup
./scripts/test_env.py cleanup
34 changes: 16 additions & 18 deletions .github/workflows/iroha2-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,50 @@ concurrency:

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-test:
client-cli-tests:
runs-on: [self-hosted, Linux, iroha2ci]
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
timeout-minutes: 60

steps:

- name: Maximize build space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v3
- 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
- name: Setup test Iroha 2 environment on bare metal
run: |
./scripts/test_env.py setup
- name: Mark binaries as executable
run: |
chmod +x $CLIENT_CLI_DIR
chmod +x ${{ env.CLIENT_CLI_DIR }}
- name: Install dependencies using Poetry
working-directory: client_cli/pytests
run: |
poetry install
- name: Run client cli tests
- name: Run client cli tests and upload results to Allure Test Ops
working-directory: client_cli/pytests
run: |
poetry run pytest
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'

Expand Down
1 change: 0 additions & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
POETRY_HOME=/opt/poetry \
CLIENT_CLI_DIR=/__w/iroha/iroha/test \
TORII_API_PORT_MIN=8080 \
TORII_API_PORT_MAX=8083

Expand Down
16 changes: 14 additions & 2 deletions Dockerfile.build.glibc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@ FROM archlinux:base-devel

ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
PATH=/usr/local/cargo/bin:$PATH \
POETRY_HOME=/opt/poetry \
TORII_API_PORT_MIN=8080 \
TORII_API_PORT_MAX=8083

RUN pacman -Syu rustup mold openssl libgit2 git docker docker-buildx docker-compose glibc lib32-glibc --noconfirm
ENV PATH=$POETRY_HOME/bin:$PATH

RUN pacman -Syu rustup mold openssl libgit2 git docker \
docker-buildx docker-compose glibc lib32-glibc \
python python-pip --noconfirm --disable-download-timeout && \
curl -sSL https://install.python-poetry.org | python3 -

WORKDIR /client_cli/pytests
COPY /client_cli/pytests/pyproject.toml /client_cli/pytests/poetry.lock $WORKDIR
RUN poetry install

RUN rustup toolchain install nightly-2023-06-25-x86_64-unknown-linux-gnu
RUN rustup default nightly-2023-06-25-x86_64-unknown-linux-gnu
Expand Down

0 comments on commit 66d64ed

Please sign in to comment.