Skip to content

Commit 36ee441

Browse files
committed
ci: add trigger to run compatibility tests
see https://gravitee.atlassian.net/browse/GKO-1348
1 parent 87b978d commit 36ee441

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed

.circleci/config.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ parameters:
2424
- rollout-apim
2525
- release
2626
- none
27+
apim-version:
28+
type: string
29+
default: ""
30+
description: "The version of APIM to use when we run a test suite. Leave empty to use the version defined in the hack/apim.yaml file."
2731
apim-source-branch:
2832
type: string
2933
default: ""
@@ -310,7 +314,8 @@ jobs:
310314
command: echo 'export APIM_VALUES=values-dbless.yaml' >> $BASH_ENV
311315
- run:
312316
name: Start cluster
313-
command: make start-cluster
317+
command: |
318+
APIM_IMAGE_TAG=<< pipeline.parameters.apim-version >> make start-cluster
314319
- run:
315320
name: Run IT with filter << parameters.ginkgo-filter >>
316321
command: |
@@ -1033,7 +1038,7 @@ workflows:
10331038
- << pipeline.parameters.trigger >>
10341039
jobs:
10351040
- job-integration-test:
1036-
name: Run all integration tests
1041+
name: Run integration tests with APIM version << pipeline.parameters.apim-version >>
10371042
context: cicd-orchestrator
10381043
ginkgo-filter: integration
10391044
pre-steps:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Trigger Compatibility Test
16+
on:
17+
workflow_dispatch: {}
18+
push:
19+
branches:
20+
- gko-1348-apim-compatibility
21+
jobs:
22+
trigger-test-suite:
23+
runs-on: ubuntu-latest
24+
env:
25+
BRANCH: ${{ matrix.branch }}
26+
APIM_VERSION: ${{ matrix.apim-version }}
27+
CIRCLECI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
branch:
32+
- 4.5.x
33+
- 4.6.x
34+
- 4.7.x
35+
- 4.8.x
36+
- 4.9.x
37+
apim-version:
38+
- 4.5.x-latest
39+
- 4.6.x-latest
40+
- 4.7.x-latest
41+
- 4.8.x-latest
42+
- 4.9.x-latest
43+
- master-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0
48+
persist-credentials: false
49+
- name: Trigger test pipeline and notify on failure
50+
run: |
51+
echo "🧪 Triggering test pipeline"
52+
npx zx hack/scripts/trigger-test.mjs --notify true --branch ${BRANCH} --apimVersion ${APIM_VERSION}

hack/scripts/trigger-test.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,40 @@ import { triggerPipeline } from "./lib/circleci.mjs";
1818

1919
import { toggleVerbosity, LOG } from "./lib/index.mjs";
2020

21+
import { Version } from "./lib/version.mjs";
22+
2123
const VERBOSE = argv.verbose;
2224
const BRANCH = argv["branch"];
2325
const NOTIFY = argv["notify"] === "true" || argv["notify"] === true;
26+
const APIM_VERSION = argv["apimVersion"];
27+
28+
const apimVersion = new Version(APIM_VERSION);
29+
const gkoVersion = new Version(BRANCH);
30+
31+
if (apimVersion !== "master-latest") {
32+
if (apimVersion.majorDigit < gkoVersion.majorDigit) {
33+
LOG.blue(
34+
`Skipping test because we don't support forward compatibility between major versions`,
35+
);
36+
process.exit(0);
37+
}
38+
39+
if (apimVersion.minorDigit < gkoVersion.minorDigit) {
40+
LOG.blue(
41+
`Skipping test because we don't support forward compatibility between minor versions`,
42+
);
43+
process.exit(0);
44+
}
45+
}
46+
2447

2548
toggleVerbosity(VERBOSE);
2649

2750
LOG.blue(`Triggering test pipeline`);
2851

2952
const parameters = {
3053
trigger: "test",
54+
"apim-version": APIM_VERSION,
3155
notify: NOTIFY,
3256
};
3357

0 commit comments

Comments
 (0)