Skip to content

Commit

Permalink
do not spawn so many unnecessary jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Aug 25, 2023
1 parent 065df09 commit 5437c3c
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 15 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/integration-test-enterprise.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ jobs:
if: needs.secret-available.outputs.ok
strategy:
matrix:
# Skip explicitly to avoid spawning many unecessary jobs,
# since expressions router is supported for Kong >= 3.0.
# Option router_flavor is ignored for Kong < 3.0.
exclude:
- kong_version: '2.2'
router_flavor: 'expressions'
- kong_version: '2.3'
router_flavor: 'expressions'
- kong_version: '2.4'
router_flavor: 'expressions'
- kong_version: '2.5'
router_flavor: 'expressions'
- kong_version: '2.6'
router_flavor: 'expressions'
- kong_version: '2.7'
router_flavor: 'expressions'
- kong_version: '2.8'
router_flavor: 'expressions'
router_flavor:
- 'traditional_compatible'
- 'expressions'
Expand All @@ -52,6 +70,7 @@ jobs:
- '3.1'
- '3.2'
- '3.3'
- '3.4'
env:
KONG_ROUTER_FLAVOR: ${{ matrix.router_flavor }}
KONG_IMAGE_TAG: ${{ matrix.kong_version }}
Expand Down
49 changes: 36 additions & 13 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,48 @@ jobs:
test:
strategy:
matrix:
kong_version:
- '2.1'
- '2.2'
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '2.8'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
# Skip explicitly to avoid spawning many unecessary jobs,
# since expressions router is supported for Kong >= 3.0.
# Option router_flavor is ignored for Kong < 3.0.
exclude:
- kong_version: '2.1'
router_flavor: 'expressions'
- kong_version: '2.2'
router_flavor: 'expressions'
- kong_version: '2.2'
router_flavor: 'expressions'
- kong_version: '2.3'
router_flavor: 'expressions'
- kong_version: '2.4'
router_flavor: 'expressions'
- kong_version: '2.5'
router_flavor: 'expressions'
- kong_version: '2.6'
router_flavor: 'expressions'
- kong_version: '2.7'
router_flavor: 'expressions'
- kong_version: '2.8'
router_flavor: 'expressions'
dbmode:
- 'dbless'
- 'postgres'
router_flavor:
- 'traditional_compatible'
- 'expressions'
kong_version:
- '2.1'
- '2.2'
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
- '2.8'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'
env:
KONG_ROUTER_FLAVOR: ${{ matrix.router_flavor }}
KONG_IMAGE_TAG: ${{ matrix.kong_version }}
Expand Down
2 changes: 2 additions & 0 deletions kong/plugin_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestPluginsServiceValidation(T *testing.T) {

func TestPluginsService(T *testing.T) {
RunWhenDBMode(T, "postgres")
SkipWhenKongRouterFlavor(T, Expressions)

assert := assert.New(T)
require := require.New(T)
Expand Down Expand Up @@ -403,6 +404,7 @@ func TestPluginListEndpoint(T *testing.T) {

func TestPluginListAllForEntityEndpoint(T *testing.T) {
RunWhenDBMode(T, "postgres")
SkipWhenKongRouterFlavor(T, Expressions)

assert := assert.New(T)
require := require.New(T)
Expand Down
3 changes: 3 additions & 0 deletions kong/route_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func TestRoutesRoute(T *testing.T) {
RunWhenDBMode(T, "postgres")
SkipWhenEnterprise()

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, traditional_compatible)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, expressions)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, expressions, 3.1)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, expressions, 3.0)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, expressions, 3.2)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test (dbless, expressions, 3.3)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.4)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions, 3.1)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions, 3.2)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.3)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.5)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions, 3.4)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.8)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions, 3.3)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (expressions, 3.0)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.6)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.2)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 2.7)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 3.0)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 3.4)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 3.2)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 3.3)

not enough arguments in call to SkipWhenEnterprise

Check failure on line 14 in kong/route_service_test.go

View workflow job for this annotation

GitHub Actions / test-enterprise (traditional_compatible, 3.1)

not enough arguments in call to SkipWhenEnterprise

assert := assert.New(T)
require := require.New(T)
Expand Down Expand Up @@ -104,6 +105,8 @@ func TestRoutesRoute(T *testing.T) {
func TestRouteWithTags(T *testing.T) {
RunWhenDBMode(T, "postgres")
RunWhenKong(T, ">=1.1.0")
SkipWhenKongRouterFlavor(T, Traditional, TraditionalCompatible)

require := require.New(T)

client, err := NewTestClient(nil, nil)
Expand Down
2 changes: 1 addition & 1 deletion kong/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func SkipWhenKongRouterFlavor(t *testing.T, flavor ...RouterFlavor) {
}
for _, f := range flavor {
if RouterFlavor(routerFlavor) == f {
t.Skipf("detected Kong running with router flavor:%q but requested router flavor:%q", routerFlavor, f)
t.Skipf("router flavor:%q skipping", f)
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion kong/vault_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func TestVaultsService(t *testing.T) {
require.Equal(id, *createdVault.ID)
require.Equal("aws", *createdVault.Name)
require.Equal("aws vault for secrets", *createdVault.Description)
require.Equal(Configuration{"region": "us-east-2"}, createdVault.Config)
region, ok := createdVault.Config["region"]
require.Equal(true, ok)
require.Equal("us-east-2", region)

err = client.Vaults.Delete(defaultCtx, createdVault.ID)
require.NoError(err)
Expand Down

0 comments on commit 5437c3c

Please sign in to comment.