Skip to content

Commit

Permalink
Merge pull request #136 from chatwork/reorg-tests
Browse files Browse the repository at this point in the history
Reorganize tests into three groups
  • Loading branch information
hanayo04 authored Nov 19, 2024
2 parents 38944ed + defeb7b commit 687b183
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 13 deletions.
46 changes: 37 additions & 9 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,30 @@ concurrency:

jobs:
test:
environment: test
runs-on: ubuntu-latest
timeout-minutes: 6
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.3'
check-latest: true
- name: Run tests
run: make test
kindtest:
environment: test
strategy:
matrix:
kind_image:
- "kindest/node:v1.29.8@sha256:d46b7aa29567e93b27f7531d258c372e829d7224b25e3fc6ffdefed12476d3aa"
- "kindest/node:v1.30.4@sha256:976ea815844d5fa93be213437e3ff5754cd599b040946b5cca43ca45c2047114"
runs-on: ubuntu-latest
# Have enough timeout for `make e2e`
# which requires up to 45 minutes to run.
timeout-minutes: 55
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -36,14 +50,28 @@ jobs:
check-latest: true
- name: Install cloud-provider-kind
run: make cloud-provider-kind
- name: Run tests
run: make test
# In near future, we might want to run this
# only when triggered manually or on a schedule.
- name: Run E2E tests
run: make e2e
- name: Run E2E tests on kind
run: make e2e/kindtest
env:
KIND_IMAGE: ${{ matrix.kind_image }}
ekstest:
environment: test
runs-on: ubuntu-latest
# Have enough timeout for `make e2e`
# which requires up to 45 minutes to run.
timeout-minutes: 55
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.3'
check-latest: true
- name: Run E2E tests on EKS
run: make e2e/ekstest
golangci:
name: lint
runs-on: ubuntu-latest
Expand Down
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ lint:

.PHONY: test
test:
go test -short -timeout 6m -v ./...
go test -timeout 6m -v ./util/... ./config/...

.PHONY: e2e
e2e:
go test -timeout 45m -v ./...
.PHONY: e2e/kindtest
e2e/kindtest:
go test -timeout 20m -v ./cmd/...

.PHONY: e2e/ekstest
e2e/ekstest:
go test -timeout 55m -v ./cmd/... -tags=ekstest

# This will produce following images for testing locally:
# - examplecom/kibertas:canary-arm64
Expand Down
2 changes: 2 additions & 0 deletions cmd/cert-manager/cert-manager_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !ekstest

package certmanager

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/cluster-autoscaler/cluster_autoscaler_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ekstest

package clusterautoscaler

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/cluster-autoscaler/karpenter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ekstest

package clusterautoscaler

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/datadog-agent/datadog-agent_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !ekstest

package datadogagent

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/fluent/fluent_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build ekstest

package fluent

import (
Expand Down
2 changes: 2 additions & 0 deletions cmd/ingress/ingress_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build !ekstest

package ingress

import (
Expand Down

0 comments on commit 687b183

Please sign in to comment.