Skip to content

Commit

Permalink
min & max supported envoy version to run CI with (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinFalkowski authored Feb 21, 2023
1 parent aeb6b3c commit 9ce0e60
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci-min-envoy-version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: CI - min envoy version

on:
workflow_dispatch:

jobs:
ci:
uses: ./.github/workflows/ci.yaml
with:
envoyVersion: min
secrets: inherit
13 changes: 12 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ name: CI

on:
workflow_dispatch:
inputs:
envoyVersion:
type: string
description: "envoy version to run tests on, e.g. 'v1.24.0'. Special values: 'max' - max supported version, 'min' - min supported version"
default: max

push:
paths-ignore:
- 'readme.md'

workflow_call:
inputs:
envoyVersion:
type: string
default: max

jobs:
ci:
name: CI
Expand Down Expand Up @@ -38,7 +49,7 @@ jobs:
${{ runner.os }}-gradle-
- name: Test with Gradle
run: ./gradlew clean check
run: ./gradlew clean check -PenvoyVersion=${{ inputs.envoyVersion }}

- name: Junit report
uses: mikepenz/action-junit-report@v2
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Lists all changes with user impact.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [0.19.30]

### Changed
- specify min and max supported envoy version
- add option to run tests on specific envoy version, including min and max supported version

## [0.19.29]

### Changed
Expand Down
21 changes: 21 additions & 0 deletions envoy-control-tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
def MIN_SUPPORTED_ENVOY_VERSION = "v1.22.7"
def MAX_SUPPORTED_ENVOY_VERSION = "v1.24.0"

dependencies {
implementation project(':envoy-control-runner')

Expand All @@ -19,6 +22,19 @@ dependencies {
implementation group: 'org.testcontainers', name: 'testcontainers', version: versions.testcontainers
}

String envoyVersion = { ->
String versionArg = project.findProperty("envoyVersion") ?: "max"
if (versionArg == "max") {
return MAX_SUPPORTED_ENVOY_VERSION
} else if (versionArg == "min") {
return MIN_SUPPORTED_ENVOY_VERSION
} else {
return versionArg
}
}()

println("Using envoy version: $envoyVersion")

test {
useJUnitPlatform {
excludeTags 'reliability'
Expand All @@ -39,3 +55,8 @@ task reliabilityTest(type: Test) {
}
testClassesDirs = project.sourceSets.main.output.classesDirs
}

tasks.withType(Test).configureEach {
systemProperty("pl.allegro.tech.servicemesh.envoyVersion", envoyVersion)
}

Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ class EnvoyContainer(
const val ENVOY_UID_ENV_NAME = "ENVOY_UID"
const val EGRESS_LISTENER_CONTAINER_PORT = 5000
const val INGRESS_LISTENER_CONTAINER_PORT = 5001
const val DEFAULT_IMAGE = "envoyproxy/envoy:v1.24.0"
private const val ADMIN_PORT = 10000

val DEFAULT_IMAGE = run {
val key = "pl.allegro.tech.servicemesh.envoyVersion"
val version = System.getProperty(key) ?: throw IllegalStateException("Missing '$key' system property")
"envoyproxy/envoy:$version"
}
}

override fun configure() {
Expand Down

0 comments on commit 9ce0e60

Please sign in to comment.