From f1ab0433bb89c5341578511f9e0cbed67c9e2120 Mon Sep 17 00:00:00 2001 From: stephengaudet <32783698+stephengaudet@users.noreply.github.com> Date: Tue, 16 May 2023 10:00:24 -0700 Subject: [PATCH] Sg integrationtest chainprotocol (#359) * update integration test readme * readme feedback incorporated * remove Log.Fatal and improve logging on fail * revert to Mumbai. change to Nairobi was a mistake - tests with chainID in them break there * sg-integration-test adding chain protocol via env var * sg-integrationtest fix workflow env var * sg-integrationtest fix workflow path to env file * sg-integrationtest more fixing of paths * sg-integrationtest fix test step * sg-integrationtest simplify workflow's env var * sg-integrationtest remove use of --env-var option and update readme * sg-integrationtest small readme update * sg-integrationtest update readme with re-running tests instruction --- .github/workflows/build.yaml | 26 +++++++---------- integration_test/README.md | 45 +++++++++++++++++++---------- integration_test/docker-compose.yml | 2 +- integration_test/env.current.amd64 | 2 ++ integration_test/env.current.arm64 | 2 ++ integration_test/env.next.amd64 | 2 ++ integration_test/env.next.arm64 | 2 ++ integration_test/flextesa.sh | 4 +-- 8 files changed, 51 insertions(+), 34 deletions(-) create mode 100644 integration_test/env.current.amd64 create mode 100644 integration_test/env.current.arm64 create mode 100644 integration_test/env.next.amd64 create mode 100644 integration_test/env.next.arm64 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index fb59c4dc..2f79cf9a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -107,10 +107,9 @@ jobs: strategy: fail-fast: false matrix: - octez-versions: - - v16.0-rc3 - env: - IMAGE: ghcr.io/ecadlabs/signatory:${{ github.head_ref || github.ref_name }}-amd64 + testenvs: + - env.current.amd64 + - env.next.amd64 steps: - uses: actions/checkout@v2 - name: Login to DockerHub @@ -120,16 +119,11 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Pull images - run: > - docker pull oxheadalpha/flextesa:latest; - docker pull tezos/tezos:${{ matrix.octez-versions }}; - docker pull $IMAGE; - - name: Start containers - run: IMAGE=$IMAGE OCTEZ_VERSION=${{ matrix.octez-versions }} docker compose -f integration_test/docker-compose.yml up -d --wait - - name: Modify octez - run: docker exec octez sudo chown -R tezos /home/tezos/.tezos-client - name: Run tests - run: IMAGE=$IMAGE OCTEZ_VERSION=${{ matrix.octez-versions }} go test $(go list ./... | grep integration_test) - - name: Kill containers - run: IMAGE=$IMAGE OCTEZ_VERSION=${{ matrix.octez-versions }} docker compose -f integration_test/docker-compose.yml kill + run: > + export $(xargs --password-stdin ## Running the tests -Pull the images for the version and architecture that suit your needs from [flextesa](https://hub.docker.com/r/oxheadalpha/flextesa/tags), [tezos](https://hub.docker.com/r/tezos/tezos/tags), [signatory (pre-release)](https://github.com/ecadlabs/signatory/pkgs/container/signatory/versions), or [signatory (release)](https://hub.docker.com/r/ecadlabs/signatory/tags) +```sh +cd integration_test +``` + +Exporting the Environment Variables used by the test is required. Choose the set of env var to use from the files `env.current.arm64`, `env.next.arm64`, `env.current.amd64`, `env.next.amd64`. Use `current` if you'd like the economic protocol run by flextesa to match mainnet, use `next` if you'd like the next protocol instead. Use `arm64` or `amd64` depending on your host architecture. -Example: +So, to set the env to use mainnet protocol, using a build of Signatory's `main` branch, on a macbook m1 host: ```sh -export SIGY_IMAGE=ghcr.io/ecadlabs/signatory:main-arm64 -export OCTEZ_VERSION=arm64_v17.0-beta1 -docker pull oxheadalpha/flextesa:latest -docker pull tezos/tezos:$OCTEZ_VERSION -docker pull $SIGY_IMAGE +export $(xargs