diff --git a/.github/workflows/iroha2-dev-pr.yml b/.github/workflows/iroha2-dev-pr.yml index 4b417dc3808..1a496c9867d 100644 --- a/.github/workflows/iroha2-dev-pr.yml +++ b/.github/workflows/iroha2-dev-pr.yml @@ -18,6 +18,7 @@ concurrency: env: CARGO_TERM_COLOR: always CLIENT_CLI_DIR: "/__w/${{ github.event.repository.name }}/${{ github.event.repository.name }}/test" + DOCKER_COMPOSE_PATH: configs/swarm jobs: consistency: @@ -146,25 +147,50 @@ jobs: torii-api-and-client-cli-tests: runs-on: [self-hosted, Linux, iroha2] - container: - image: hyperledger/iroha2-ci:nightly-2024-04-18 + #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 + - name: Set up Docker Buildx + id: buildx + if: always() + uses: docker/setup-buildx-action@v3 + with: + install: true + - name: Build and export to Docker iroha:local and iroha:dev images + uses: docker/build-push-action@v6 + if: always() + with: + context: . + load: true + file: Dockerfile + tags: | + hyperledger/iroha:local + hyperledger/iroha:dev + cache-from: type=gha + cache-to: type=gha,mode=max + - name: Test docker-compose.yml containers run: | - cargo build -p iroha_client_cli -p kagami -p irohad - - name: Setup test Iroha 2 environment on the bare metal + docker compose -f ${{ env.DOCKER_COMPOSE_PATH }}/docker-compose.yml up --wait || exit 1 + - name: Show containers names + run: docker ps -a + - name: Copy build client cli bin from peer into runner run: | - pip3 install -r scripts/requirements.txt --no-input --break-system-packages - ./scripts/test_env.py setup + mkdir -p test + docker cp swarm-irohad0-1:/usr/local/bin/iroha test + cp ./configs/swarm/client.toml test - name: Mark binaries as executable run: | - chmod +x ${{ env.CLIENT_CLI_DIR }} + chmod +x test/iroha + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - - name: Install torii api dependencies using Poetry working-directory: torii/pytests run: | + poetry env use python3.11 poetry install - name: Run torii api tests working-directory: torii/pytests @@ -173,6 +199,7 @@ jobs: - name: Install client cli dependencies using Poetry working-directory: client_cli/pytests run: | + poetry env use python3.11 poetry install - name: Run client cli tests working-directory: client_cli/pytests @@ -182,6 +209,3 @@ jobs: CLIENT_CLI_CONFIG: ../../test/client.toml run: | poetry run pytest - - name: Cleanup test environment - run: | - ./scripts/test_env.py cleanup diff --git a/client_cli/pytests/common/json_isi_examples/unregister_asset.json b/client_cli/pytests/common/json_isi_examples/unregister_asset.json index 2a5f1c21d41..922457f976f 100644 --- a/client_cli/pytests/common/json_isi_examples/unregister_asset.json +++ b/client_cli/pytests/common/json_isi_examples/unregister_asset.json @@ -1,7 +1,7 @@ [{ "Unregister": { "Asset": { - "object": "rose#ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" + "object": "rose##ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland" } } }] diff --git a/client_cli/pytests/src/client_cli/client_cli.py b/client_cli/pytests/src/client_cli/client_cli.py index 8981ac500bf..f80ef9656db 100644 --- a/client_cli/pytests/src/client_cli/client_cli.py +++ b/client_cli/pytests/src/client_cli/client_cli.py @@ -302,7 +302,7 @@ def _execute_isi(self, temp_file_path): :type temp_file_path: str """ self._execute_pipe( - ["cat", temp_file_path], [self.BASE_PATH] + self.BASE_FLAGS + ["json"] + ["cat", temp_file_path], [self.BASE_PATH] + self.BASE_FLAGS + ["json"] + ["transaction"] ) def register_trigger(self, account):