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

chore: test suite refactor #2289

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: ./.github/composite/go-setup
- name: Check embedded templates content
run: |
if ! go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem; then
if ! make check-embedded-fs; then
echo "Content of templates directory and embedded FS (zz_filesystem_generated.go) doesn't match!"
echo "Consult https:.github.com/knative/func/blob/main/docs/CONTRIBUTING.md#templates ."
exit 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Func Check Schema
name: Func Schema Check

on: [pull_request]

Expand All @@ -12,5 +12,5 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/composite/go-setup
- name: Check that 'func.yaml schema' is up-to-date
run: make schema-check
- name: Check 'func.yaml'
run: make check-schema
101 changes: 12 additions & 89 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,16 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/composite/go-setup
- name: Lint
run: make check && make check-templates
- name: Check that 'func.yaml schema' is up-to-date
run: make schema-check
- name: Check embedded templates content
run: go test -run "^\QTestFileSystems\E$/^\Qembedded\E$" ./pkg/filesystem
- name: Lint Core
run: make check
- name: Lint Templates
run: make check-templates
- name: Check 'func.yaml' schema
run: make check-schema
- name: Check embedded FS
run: make check-embedded-fs

test-unit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not recommend deleting these.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make test-all run really all tests? What about coverage have you ensured that there are no conflicts?

strategy:
matrix:
java: [ 21 ]
os: [ "ubuntu-latest", "windows-latest", "macos-latest" ]
runs-on: ${{ matrix.os }}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: ./.github/composite/go-setup
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Unit Test
run: make test
- name: Template Unit Tests
run: make test-templates
- uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: unit-tests-${{ matrix.os }}

test-integration:
tests:
runs-on: "ubuntu-latest"
steps:
- name: Set Environment Variables
Expand All @@ -56,69 +36,12 @@ jobs:
run: ./hack/registry.sh
- name: Setup testing images
run: ./hack/setup-testing-images.sh
- name: Integration Tests
run: make test-integration
- uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: integration-tests

e2e-test:
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Set Environment Variables
run: |
echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV"
echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
- uses: ./.github/composite/go-setup
- name: Install Binaries
run: ./hack/binaries.sh
- name: Allocate Cluster
run: ./hack/allocate.sh
- name: Local Registry
run: ./hack/registry.sh
- name: E2E Test
run: make test-e2e
- uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: e2e-test

e2e-on-cluster-test:
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Set Environment Variables
run: |
echo "KUBECONFIG=${{ github.workspace }}/hack/bin/kubeconfig.yaml" >> "$GITHUB_ENV"
echo "PATH=${{ github.workspace }}/hack/bin:$PATH" >> "$GITHUB_ENV"
- uses: actions/checkout@v3
- uses: ./.github/composite/go-setup
- uses: imjasonh/setup-ko@v0.6
- name: Install Binaries
run: ./hack/binaries.sh
- name: Allocate Cluster
run: ./hack/allocate.sh
- name: Setup testing images
run: ./hack/setup-testing-images.sh
- name: Deploy Tekton
run: ./hack/install-tekton.sh
- name: Deploy Test Git Server
run: ./hack/install-git-server.sh
- name: E2E On Cluster Test
env:
E2E_RUNTIMES: ""
run: make test-e2e-on-cluster
- name: Test All
run: make test-all
- uses: codecov/codecov-action@v4
with:
files: ./coverage.txt
flags: e2e-test-oncluster
flags: e2e

build:
needs: [check, test-unit, test-integration, e2e-test, e2e-on-cluster-test]
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/test-e2e-oncluster-runtime.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/test-e2e-oncluster.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/test-e2e-runtime.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/test-e2e.yaml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/test-integration.yaml

This file was deleted.

Loading
Loading