Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize tests into three groups #136

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading