mirror of
https://github.com/floci-io/floci.git
synced 2026-11-30 00:45:17 -05:00
The partition compatibility nightly ran the Java SDK suite in cn-north-1
only. GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no
global endpoints) take their own code paths and had no end-to-end check.
The job is now a matrix of cn-north-1, us-gov-west-1 and eusc-de-east-1;
a dispatch that names a region runs that region alone.
Measured locally on main 367ae0b2d with a JVM image: a us-east-1 control
run and one run per new region, 2461 tests each. Beyond the control
run's one failure, GovCloud showed one and EUSC four, all in tests that
assumed the commercial partition, so they are fixed here and both new
allowlists start empty:
- WafV2Test.cloudfrontScopeIsolated created a CLOUDFRONT-scope IP set,
which Floci refuses where CloudFront does not exist. It now runs only
in the partitions that have CloudFront.
- S3Test built its LocationConstraint through the SDK enum, which has no
value for eusc-de-east-1 and is then sent as the literal "null". It
passes the region id as a string.
The workflow checks the suite out at the commit the nightly image was
built from, so the new legs first run with these fixes on the nightly
after this lands.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
168 lines
6.6 KiB
YAML
168 lines
6.6 KiB
YAML
name: Partition Compatibility
|
|
|
|
# The Java SDK suite against a Floci deployed in a non-commercial partition, so
|
|
# the SDK's own partition logic (arn:aws-cn: ARNs, China signing scopes, the
|
|
# LocationConstraint S3 CreateBucket sends) has to round-trip end to end. One leg
|
|
# per partition family: China, GovCloud and EUSC. Part of #4272.
|
|
#
|
|
# Runs after each Nightly against the image it just published, not per PR: it
|
|
# is three more ~15 minute native suites, and the per-PR legs already queue for
|
|
# the shared runner pools (see compatibility.yml). Known failures live in
|
|
# .github/ci/compat-partition-allowlist-<region>.txt (a region without one has
|
|
# none); a failure missing from it, or an entry that no longer fails, fails the
|
|
# run, so the list only shrinks.
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: [Nightly]
|
|
types: [completed]
|
|
workflow_dispatch:
|
|
inputs:
|
|
image:
|
|
description: Floci image to test
|
|
default: floci/floci:nightly
|
|
region:
|
|
description: Run this one region only (any region Floci serves); blank runs every nightly leg
|
|
default: ''
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
sdk-test-java:
|
|
name: sdk-test-java / ${{ matrix.region }}
|
|
if: >-
|
|
!github.event.repository.fork
|
|
&& (github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success')
|
|
runs-on: ubuntu-24.04-arm
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# One region per partition family that takes its own code path: China (IAM signs
|
|
# cn-north-1), GovCloud (IAM signs us-gov-west-1, no CloudFront) and EUSC (no global
|
|
# endpoints at all). A dispatch that names a region runs that region alone.
|
|
region: ${{ fromJSON(inputs.region && format('["{0}"]', inputs.region) || '["cn-north-1", "us-gov-west-1", "eusc-de-east-1"]') }}
|
|
env:
|
|
IMAGE: ${{ inputs.image || 'floci/floci:nightly' }}
|
|
REGION: ${{ matrix.region }}
|
|
|
|
steps:
|
|
# The tag is mutable, so the suite and allowlist are checked out at the commit this exact
|
|
# image was built from (its OCI revision label, which Nightly sets), never a guessed one.
|
|
- name: Pull the image and read the commit it was built from
|
|
id: image
|
|
run: |
|
|
docker pull "$IMAGE"
|
|
revision=$(docker inspect -f '{{ index .Config.Labels "org.opencontainers.image.revision" }}' "$IMAGE")
|
|
if [ -z "$revision" ] || [ "$revision" = "<no value>" ]; then
|
|
echo "::error::$IMAGE has no org.opencontainers.image.revision label to match the tests to"
|
|
exit 1
|
|
fi
|
|
echo "revision=$revision" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: ${{ steps.image.outputs.revision }}
|
|
sparse-checkout: |
|
|
compatibility-tests
|
|
.github/ci
|
|
|
|
- name: Create Docker network
|
|
run: docker network create compat-net
|
|
|
|
- name: Start floci
|
|
run: |
|
|
DOCKER_GID=$(stat -c '%g' /var/run/docker.sock)
|
|
docker run -d --name floci --network compat-net \
|
|
-p 4566:4566 \
|
|
-v /var/run/docker.sock:/var/run/docker.sock \
|
|
--group-add "$DOCKER_GID" \
|
|
-e FLOCI_DEFAULT_REGION="$REGION" \
|
|
-e FLOCI_BASE_URL=http://floci:4566 \
|
|
-e FLOCI_SERVICES_DOCKER_NETWORK=compat-net \
|
|
-e FLOCI_HOSTNAME=floci \
|
|
-e FLOCI_SERVICES_IOT_MQTT_ENABLED=true \
|
|
-e FLOCI_SERVICES_LAMBDA_HOT_RELOAD_ENABLED=true \
|
|
-e FLOCI_TLS_ENABLED=true \
|
|
-e FLOCI_SERVICES_EC2_MOCK=true \
|
|
-e FLOCI_SERVICES_REDSHIFT_ENDPOINT_HOST=floci \
|
|
-e FLOCI_SERVICES_RDS_ENDPOINT_HOST=floci \
|
|
-e FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID=11111111-2222-3333-4444-555555555555 \
|
|
"$IMAGE"
|
|
|
|
- name: Wait for floci to be healthy
|
|
run: |
|
|
health=starting
|
|
for _ in $(seq 1 60); do
|
|
health=$(docker inspect -f '{{.State.Health.Status}}' floci)
|
|
if [ "$health" = healthy ]; then
|
|
exit 0
|
|
fi
|
|
if [ "$health" = unhealthy ]; then
|
|
break
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo "::error::floci did not report healthy (last status: $health)"
|
|
docker logs --tail 50 floci
|
|
exit 1
|
|
|
|
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
|
|
- name: Build test image
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
with:
|
|
context: compatibility-tests/sdk-test-java
|
|
load: true
|
|
tags: compat-sdk-test-java
|
|
cache-from: type=gha,scope=sdk-test-java
|
|
|
|
# The suite's exit status is not the verdict here: the allowlist check below is.
|
|
- name: Run tests
|
|
id: tests
|
|
continue-on-error: true
|
|
run: |
|
|
mkdir -p test-results /tmp/floci-hot-reload
|
|
FLOCI_IP=$(docker inspect -f '{{(index .NetworkSettings.Networks "compat-net").IPAddress}}' floci)
|
|
docker run --rm --network compat-net \
|
|
--dns "${FLOCI_IP}" \
|
|
-e AWS_REGION="$REGION" \
|
|
-e FLOCI_ENDPOINT=http://floci:4566 \
|
|
-e FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 \
|
|
-e HOT_RELOAD_BASE_DIR=/tmp/floci-hot-reload \
|
|
-v /tmp/floci-hot-reload:/tmp/floci-hot-reload \
|
|
-v "$(pwd)/test-results:/results" \
|
|
compat-sdk-test-java
|
|
|
|
# Maven exits non-zero for the allowlisted failures too, so its status cannot tell a
|
|
# finished run from an aborted one; the checker requires a report for every test class.
|
|
- name: Compare failures with the allowlist
|
|
run: >-
|
|
python3 .github/ci/compat-allowlist-check.py test-results
|
|
".github/ci/compat-partition-allowlist-$REGION.txt"
|
|
--test-sources compatibility-tests/sdk-test-java/src/test/java
|
|
|
|
- name: Generate test summary
|
|
if: always()
|
|
uses: test-summary/action@37b508cfee6d4d080eedd00b5bb240a6a784a6a5 # v2
|
|
with:
|
|
paths: test-results/*.xml
|
|
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: compat-partition-results-${{ env.REGION }}
|
|
path: test-results/
|
|
if-no-files-found: warn
|
|
|
|
- name: Dump floci logs
|
|
if: failure() || cancelled()
|
|
run: docker logs --tail 300 floci
|