diff --git a/.github/actions/run-faucet-tests/action.yaml b/.github/actions/run-faucet-tests/action.yaml index dfdf2b95922e4a..01473222f88583 100644 --- a/.github/actions/run-faucet-tests/action.yaml +++ b/.github/actions/run-faucet-tests/action.yaml @@ -50,7 +50,7 @@ runs: # we don't pass the image tag. - name: Run integration tests if: ${{ inputs.NETWORK != 'custom' }} - run: poetry run python main.py --base-network ${{ inputs.NETWORK }} ${{ endif }} --external-test-dir ${{ runner.temp }}/testnet --image-repo-with-project ${{ inputs.GCP_DOCKER_ARTIFACT_REPO }} + run: poetry run python main.py --base-network ${{ inputs.NETWORK }} --external-test-dir ${{ runner.temp }}/testnet --image-repo-with-project ${{ inputs.GCP_DOCKER_ARTIFACT_REPO }} working-directory: crates/aptos-faucet/integration-tests shell: bash diff --git a/.github/workflows/faucet-tests-prod.yaml b/.github/workflows/faucet-tests-prod.yaml index d56211b779d2dd..8bf21724a57eda 100644 --- a/.github/workflows/faucet-tests-prod.yaml +++ b/.github/workflows/faucet-tests-prod.yaml @@ -9,7 +9,7 @@ name: "Faucet Integration Tests: Prod" on: - pull_request_target: + pull_request: types: [labeled, opened, synchronize, reopened, auto_merge_enabled] push: branches: diff --git a/crates/aptos-faucet/integration-tests/main.py b/crates/aptos-faucet/integration-tests/main.py index c9ced3fa12b88e..b325d8733f20a9 100644 --- a/crates/aptos-faucet/integration-tests/main.py +++ b/crates/aptos-faucet/integration-tests/main.py @@ -97,7 +97,9 @@ def main(): else: logging.getLogger().setLevel(logging.INFO) - if platform.system() == "Darwin" and platform.processor().startswith("arm"): + # If we're on Mac and DOCKER_DEFAULT_PLATFORM is not already set, set it to + # linux/amd64 since we only publish images for that platform. + if platform.system().lower() == "darwin" and platform.processor().lower().startswith("arm"): if not os.environ.get("DOCKER_DEFAULT_PLATFORM"): os.environ["DOCKER_DEFAULT_PLATFORM"] = "linux/amd64" LOG.info( diff --git a/crates/aptos/e2e/main.py b/crates/aptos/e2e/main.py index 90dbb882fcd1cb..25668cdcda0ad7 100644 --- a/crates/aptos/e2e/main.py +++ b/crates/aptos/e2e/main.py @@ -25,7 +25,9 @@ import argparse import logging +import os import pathlib +import platform import shutil import sys @@ -193,6 +195,16 @@ def main(): shutil.rmtree(args.working_directory, ignore_errors=True) pathlib.Path(args.working_directory).mkdir(parents=True, exist_ok=True) + # If we're on Mac and DOCKER_DEFAULT_PLATFORM is not already set, set it to + # linux/amd64 since we only publish images for that platform. + if platform.system().lower() == "darwin" and platform.processor().lower().startswith("arm"): + if not os.environ.get("DOCKER_DEFAULT_PLATFORM"): + os.environ["DOCKER_DEFAULT_PLATFORM"] = "linux/amd64" + LOG.info( + "Detected ARM Mac and DOCKER_DEFAULT_PLATFORM was not set, setting it " + "to linux/amd64" + ) + # Run a node + faucet and wait for them to start up. container_name = run_node( args.base_network, args.image_repo_with_project, not args.no_pull_always