mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-05-06 01:16:44 +00:00
Implementing e2e during CI (#62)
This commit is contained in:
committed by
GitHub
parent
52e9419f68
commit
e481a4ff5f
@@ -18,7 +18,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Run golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2.2.0
|
||||
with:
|
||||
@@ -27,3 +26,30 @@ jobs:
|
||||
# if set to true and the action runs on a pull request - the action outputs only newly found issues
|
||||
only-new-issues: false
|
||||
args: --timeout 2m
|
||||
kind:
|
||||
name: e2e
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
# Cache Go modules
|
||||
- name: Cache Go Modules
|
||||
uses: actions/cache@v1
|
||||
env:
|
||||
cache-name: cache-go-modules
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
# Installing Ginkgo
|
||||
- name: installing Ginkgo
|
||||
run: go get github.com/onsi/ginkgo/ginkgo
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: '^1.13.8'
|
||||
- uses: engineerd/setup-kind@v0.4.0
|
||||
with:
|
||||
skipClusterCreation: true
|
||||
- name: e2e testing
|
||||
run: make e2e
|
||||
@@ -20,7 +20,6 @@ package e2e
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
@@ -82,7 +81,7 @@ var _ = Describe("when Tenant handles Ingress classes", func() {
|
||||
}
|
||||
_, err = cs.ExtensionsV1beta1().Ingresses(ns.GetName()).Create(context.TODO(), i, metav1.CreateOptions{})
|
||||
return
|
||||
}, 30*time.Second, time.Second).ShouldNot(Succeed())
|
||||
}, defaultTimeoutInterval, defaultPollInterval).ShouldNot(Succeed())
|
||||
})
|
||||
By("specifying a forbidden class", func() {
|
||||
Eventually(func() (err error) {
|
||||
@@ -100,7 +99,7 @@ var _ = Describe("when Tenant handles Ingress classes", func() {
|
||||
}
|
||||
_, err = cs.ExtensionsV1beta1().Ingresses(ns.GetName()).Create(context.TODO(), i, metav1.CreateOptions{})
|
||||
return
|
||||
}, 30*time.Second, time.Second).ShouldNot(Succeed())
|
||||
}, defaultTimeoutInterval, defaultPollInterval).ShouldNot(Succeed())
|
||||
})
|
||||
})
|
||||
It("should allow enabled Ingress class", func() {
|
||||
@@ -116,9 +115,11 @@ var _ = Describe("when Tenant handles Ingress classes", func() {
|
||||
i := &v1beta12.Ingress{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: c,
|
||||
Annotations: map[string]string{
|
||||
"kubernetes.io/ingress.class": c,
|
||||
},
|
||||
},
|
||||
Spec: v1beta12.IngressSpec{
|
||||
IngressClassName: pointer.StringPtr(c),
|
||||
Backend: &v1beta12.IngressBackend{
|
||||
ServiceName: "foo",
|
||||
ServicePort: intstr.FromInt(8080),
|
||||
@@ -127,7 +128,7 @@ var _ = Describe("when Tenant handles Ingress classes", func() {
|
||||
}
|
||||
_, err = cs.ExtensionsV1beta1().Ingresses(ns.GetName()).Create(context.TODO(), i, metav1.CreateOptions{})
|
||||
return
|
||||
}, 30*time.Second, time.Second).Should(Succeed())
|
||||
}, defaultTimeoutInterval, defaultPollInterval).Should(Succeed())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user