diff --git a/Taskfile.yml b/Taskfile.yml index bfca210..dacca81 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -538,8 +538,11 @@ tasks: . - rm -f {{ .KUBECONFIG_PATH }} + # Run e2e tests on the kind cluster specified by KIND_CLUSTER_NAME integration:e2e: desc: Run the e2e tests + summary: | + Run e2e against the Kind cluster specified by KIND_CLUSTER_NAME deps: - integration:deploy-to-kind run: once @@ -555,14 +558,8 @@ tasks: sh: docker inspect --format '{{"{{"}} (index (index .HostConfig.PortBindings "6443/tcp") 0).HostPort {{"}}"}}' {{ .KIND_CLUSTER_NAME }}-control-plane cmds: - kind get kubeconfig --name {{ .KIND_CLUSTER_NAME }} > {{ .KUBECONFIG_PATH }} - # kind writes the external server address as https://127.0.0.1:, which is only valid on - # the host. Rewrite it to the "kubernetes" alias that --svc below binds inside the dagger container. + - defer: rm -f {{ .KUBECONFIG_PATH }} - > - sed -i.bak "s#server: https://[^:]*:[0-9]*#server: https://kubernetes:{{ .KIND_HOSTPORT }}#" {{ .KUBECONFIG_PATH }} - - > - GITHUB_REF= dagger call -m dagger/e2e/ run - --source . - --kubeconfig {{.KUBECONFIG_PATH}} - --svc tcp://127.0.0.1:{{.KIND_HOSTPORT}} - --go-version {{.GO_VERSION}} - - rm -f {{ .KUBECONFIG_PATH }} {{ .KUBECONFIG_PATH }}.bak + kubectl --kubeconfig={{.KUBECONFIG_PATH}} config set-cluster kind-{{.KIND_CLUSTER_NAME}} + --server=https://127.0.0.1:{{.KIND_HOSTPORT}} --insecure-skip-tls-verify=true + - KUBECONFIG={{.KUBECONFIG_PATH}} go test ./test/e2e/... -v -ginkgo.v -timeout 45m