Skip to content

chore(PocketIC): use sequence numbers as state labels #8

chore(PocketIC): use sequence numbers as state labels

chore(PocketIC): use sequence numbers as state labels #8

Workflow file for this run

name: CI PocketIC
on:
merge_group:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
branches:
- master
- 'dev-gh-*'
pull_request:
branches-ignore:
- hotfix-* # This is to ensure that this workflow is not triggered twice on ic-private, as it's already triggered from release-testing
# Used as reusable workflow within release-testing workflow
workflow_call:
# runs for the same workflow are cancelled on PRs but not on master
# explanation: on push to master head_ref is not set, so we want it to fall back to run_id so it is not cancelled
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CI_COMMIT_SHA: ${{ github.sha }}
CI_JOB_NAME: ${{ github.job }}
CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
CI_PIPELINE_SOURCE: ${{ github.event_name }}
CI_PROJECT_DIR: ${{ github.workspace }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CI_RUN_ID: ${{ github.run_id }}
RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic"
BUILDEVENT_DATASET: "github-ci-dfinity"
jobs:
pic-test-all:
name: PocketIC Test
container:
image: ghcr.io/dfinity/ic-build@sha256:ced9611af39119f62feedc8a5ad75a8fac478cb43d2d56b623023766f6ce8ca7
options: >-
-e NODE_NAME --privileged --cgroupns host -v /cache:/cache -v /var/sysimage:/var/sysimage -v /var/tmp:/var/tmp -v /ceph-s3-info:/ceph-s3-info
timeout-minutes: 90
runs-on:
group: zh1
labels: dind-large
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: ${{ github.event_name == 'pull_request' && 256 || 0 }}
- name: Before script
id: before-script
shell: bash
run: |
[ -n "${NODE_NAME:-}" ] && echo "Node: $NODE_NAME"
- name: Login to Dockerhub
shell: bash
run: ./ci/scripts/docker-login.sh
env:
DOCKER_HUB_USER: ${{ vars.DOCKER_HUB_USER }}
DOCKER_HUB_PASSWORD_RO: ${{ secrets.DOCKER_HUB_PASSWORD_RO }}
- name: Set BAZEL_EXTRA_ARGS
shell: bash
run: |
set -xeuo pipefail
# Determine which tests to skip and append 'long_test' for pull requests or merge groups
EXCLUDED_TEST_TAGS=(system_test_hourly system_test_nightly system_test_nightly_nns system_test_staging system_test_hotfix system_test_benchmark fuzz_test fi_tests_nightly nns_tests_nightly)
[[ "${{ github.event_name }}" =~ ^(pull_request|merge_group)$ ]] && EXCLUDED_TEST_TAGS+=(long_test)
# Export excluded tags as environment variable for ci/bazel-scripts/diff.sh
echo "EXCLUDED_TEST_TAGS=${EXCLUDED_TEST_TAGS[*]}" >> $GITHUB_ENV
# Prepend tags with '-' and join them with commas for Bazel
TEST_TAG_FILTERS=$(IFS=,; echo "${EXCLUDED_TEST_TAGS[*]/#/-}")
# Determine BAZEL_EXTRA_ARGS based on event type or branch name
BAZEL_EXTRA_ARGS="--test_tag_filters=$TEST_TAG_FILTERS"
if [[ "${{ github.event_name }}" == 'merge_group' ]]; then
BAZEL_EXTRA_ARGS+=" --test_timeout_filters=short,moderate --flaky_test_attempts=3"
elif [[ $BRANCH_NAME =~ ^hotfix-.* ]]; then
BAZEL_EXTRA_ARGS+=" --test_timeout_filters=short,moderate"
else
BAZEL_EXTRA_ARGS+=" --keep_going"
fi
BAZEL_EXTRA_ARGS+=" --test_arg='--nocapture'"
# Export BAZEL_EXTRA_ARGS to environment
echo "BAZEL_EXTRA_ARGS=$BAZEL_EXTRA_ARGS" >> $GITHUB_ENV
- name: Run Bazel Test All
id: bazel-test-all
uses: ./.github/actions/bazel-test-all/
env:
AWS_SHARED_CREDENTIALS_CONTENT: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }}
OVERRIDE_DIDC_CHECK: ${{ contains(github.event.pull_request.labels.*.name, 'CI_OVERRIDE_DIDC_CHECK') }}
with:
BAZEL_COMMAND: "test"
BAZEL_TARGETS: "//packages/pocket-ic:test"
BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel --test_output=streamed --cache_test_results=no"
# check if PR title contains release and set timeout filters accordingly
BAZEL_EXTRA_ARGS: ${{ env.BAZEL_EXTRA_ARGS }}
BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }}