Skip to content

Commit

Permalink
chore: change integration test default repo to a dedicated testing re…
Browse files Browse the repository at this point in the history
…po (#8197)

* chore: change integration test default repo to a dedicated testing repo

* chore: fix debug test

* chore: add gcloud auth

* chore: test

* chore: test
  • Loading branch information
ericzzzzzzz authored Dec 15, 2022
1 parent 88e1c17 commit d4369f3
Show file tree
Hide file tree
Showing 34 changed files with 56 additions and 55 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ ifeq ($(GCP_ONLY),true)
$(GKE_CLUSTER_NAME) \
--zone $(GKE_ZONE) \
--project $(GCP_PROJECT)
gcloud auth configure-docker us-central1-docker.pkg.dev
endif
@ GCP_ONLY=$(GCP_ONLY) GKE_CLUSTER_NAME=$(GKE_CLUSTER_NAME) ./hack/gotest.sh -v $(REPOPATH)/v2/integration -timeout 50m $(INTEGRATION_TEST_ARGS)

Expand Down
8 changes: 4 additions & 4 deletions integration/build_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ func TestBuildDependenciesCache(t *testing.T) {
}

func checkImagesExist(t *testing.T) {
checkImageExists(t, "gcr.io/k8s-skaffold/image1:latest")
checkImageExists(t, "gcr.io/k8s-skaffold/image2:latest")
checkImageExists(t, "gcr.io/k8s-skaffold/image3:latest")
checkImageExists(t, "gcr.io/k8s-skaffold/image4:latest")
checkImageExists(t, "us-central1-docker.pkg.dev/k8s-skaffold/testing/image1:latest")
checkImageExists(t, "us-central1-docker.pkg.dev/k8s-skaffold/testing/image2:latest")
checkImageExists(t, "us-central1-docker.pkg.dev/k8s-skaffold/testing/image3:latest")
checkImageExists(t, "us-central1-docker.pkg.dev/k8s-skaffold/testing/image4:latest")
}

func contains(sl []int, t int) bool {
Expand Down
2 changes: 1 addition & 1 deletion integration/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/GoogleContainerTools/skaffold/v2/testutil"
)

const imageName = "gcr.io/k8s-skaffold/simple-build:"
const imageName = "us-central1-docker.pkg.dev/k8s-skaffold/testing/simple-build:"

func TestBuild(t *testing.T) {
tests := []struct {
Expand Down
4 changes: 2 additions & 2 deletions integration/examples/generate-pipeline/expectedPipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand Down
4 changes: 2 additions & 2 deletions integration/examples/ko/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ substitutions:
_GKE_CLUSTER_PROJECT_ID: $PROJECT_ID
_GKE_CLUSTER_ZONE: us-central1-f
_IMAGE_REPO: gcr.io/${PROJECT_ID}
_GCLOUD_IMAGE: gcr.io/k8s-skaffold/skaffold
_SKAFFOLD_IMAGE: gcr.io/k8s-skaffold/skaffold
_GCLOUD_IMAGE: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold
_SKAFFOLD_IMAGE: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold

timeout: 1200s
2 changes: 1 addition & 1 deletion integration/examples/ko/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ profiles:
- name: gcb
build:
googleCloudBuild:
koImage: gcr.io/k8s-skaffold/skaffold:v1.37.2-lts
koImage: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:v1.37.2-lts
2 changes: 1 addition & 1 deletion integration/helm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestHelmDeploy(t *testing.T) {

// To fix #1823, we make use of env variable templating for release name
env := []string{fmt.Sprintf("TEST_NS=%s", ns.Name)}
skaffold.Deploy("--images", "gcr.io/k8s-skaffold/skaffold-helm").InDir("testdata/helm").InNs(ns.Name).WithEnv(env).RunOrFail(t)
skaffold.Deploy("--images", "us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm").InDir("testdata/helm").InNs(ns.Name).WithEnv(env).RunOrFail(t)

dep := client.GetDeployment("skaffold-helm-" + ns.Name)
testutil.CheckDeepEqual(t, dep.Name, dep.ObjectMeta.Labels["release"])
Expand Down
2 changes: 1 addition & 1 deletion integration/multiplatform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
)

const (
defaultRepo = "gcr.io/k8s-skaffold"
defaultRepo = "us-central1-docker.pkg.dev/k8s-skaffold/testing"
hybridClusterName = "integration-tests-hybrid"
armClusterName = "integration-tests-arm"
)
Expand Down
18 changes: 9 additions & 9 deletions integration/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ func TestKubectlRenderOutput(t *testing.T) {
description: "write rendered manifest to provided filepath",
builds: []graph.Artifact{
{
ImageName: "gcr.io/k8s-skaffold/skaffold",
Tag: "gcr.io/k8s-skaffold/skaffold:test",
ImageName: "us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold",
Tag: "us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:test",
},
},
input: `apiVersion: v1
kind: Pod
spec:
containers:
- image: gcr.io/k8s-skaffold/skaffold
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold
name: skaffold
`,
expectedOut: fmt.Sprintf(`apiVersion: v1
Expand All @@ -64,7 +64,7 @@ metadata:
namespace: %s
spec:
containers:
- image: gcr.io/k8s-skaffold/skaffold:test
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:test
name: skaffold`, ns.Name)}

testutil.Run(t, test.description, func(t *testutil.T) {
Expand Down Expand Up @@ -100,8 +100,8 @@ func TestKubectlRender(t *testing.T) {
description: "normal render",
builds: []graph.Artifact{
{
ImageName: "gcr.io/k8s-skaffold/skaffold",
Tag: "gcr.io/k8s-skaffold/skaffold:test",
ImageName: "us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold",
Tag: "us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:test",
},
},
input: `apiVersion: v1
Expand All @@ -110,7 +110,7 @@ metadata:
name: my-pod-123
spec:
containers:
- image: gcr.io/k8s-skaffold/skaffold
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold
name: skaffold
`,
expectedOut: fmt.Sprintf(`apiVersion: v1
Expand All @@ -120,7 +120,7 @@ metadata:
namespace: %s
spec:
containers:
- image: gcr.io/k8s-skaffold/skaffold:test
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:test
name: skaffold`, ns.Name),
},
{
Expand Down Expand Up @@ -334,7 +334,7 @@ spec:
skaffold.dev/run-id: phony-run-id
spec:
containers:
- image: gcr.io/k8s-skaffold/skaffold-helm:sha256-nonsenselettersandnumbers
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm:sha256-nonsenselettersandnumbers
imagePullPolicy: always
name: skaffold-helm
ports:
Expand Down
2 changes: 1 addition & 1 deletion integration/skaffold/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func GeneratePipeline(args ...string) *RunBuilder {
func withDefaults(command string, args []string) *RunBuilder {
repo := os.Getenv("DEFAULT_REPO")
if repo == "" {
repo = "gcr.io/k8s-skaffold"
repo = "us-central1-docker.pkg.dev/k8s-skaffold/testing"
}
return &RunBuilder{command: command, args: args, repo: repo}
}
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/build/gcb-with-platform/k8s-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example-with-location
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example-with-location
2 changes: 1 addition & 1 deletion integration/testdata/build/gcb-with-platform/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v4beta2
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/gcb-with-platform
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/gcb-with-platform
googleCloudBuild:
projectId: k8s-skaffold
region: asia-east1
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/deploy-multiple/kubectl/k8s-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
containers:
- name: deploy-kubectl
image: gcr.io/k8s-skaffold/skaffold-example
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example
2 changes: 1 addition & 1 deletion integration/testdata/deploy-multiple/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v4beta2
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example
context: ./kubectl
manifests:
rawYaml:
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/fix/k8s-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example
4 changes: 2 additions & 2 deletions integration/testdata/fix/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v1alpha1
kind: Config
build:
artifacts:
- imageName: gcr.io/k8s-skaffold/skaffold-example
- imageName: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example
workspace: .
local: {}
tagPolicy: sha256
Expand All @@ -12,4 +12,4 @@ deploy:
- paths:
- k8s-*
parameters:
IMAGE_NAME: gcr.io/k8s-skaffold
IMAGE_NAME: us-central1-docker.pkg.dev/k8s-skaffold/testing
2 changes: 1 addition & 1 deletion integration/testdata/gcb-explicit-repo/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: skaffold/v1beta4
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-explicit-repo
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-explicit-repo
googleCloudBuild: {}
2 changes: 1 addition & 1 deletion integration/testdata/gcb-with-location/k8s-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
spec:
containers:
- name: getting-started
image: gcr.io/k8s-skaffold/skaffold-example-with-location
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example-with-location
2 changes: 1 addition & 1 deletion integration/testdata/gcb-with-location/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v4beta2
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-example-with-location
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-example-with-location
googleCloudBuild:
projectId: k8s-skaffold
region: asia-east1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -86,7 +86,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -119,7 +119,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand All @@ -145,7 +145,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v1beta13
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/main-config
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/main-config
deploy:
kubectl:
manifests:
Expand All @@ -11,7 +11,7 @@ profiles:
- name: oncluster
build:
artifacts:
- image: gcr.io/k8s-skaffold/main-config-pipeline
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/main-config-pipeline
context: .
kaniko: {}
tagPolicy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: skaffold/v1beta13
kind: Config
build:
artifacts:
- image: gcr.io/k8s-skaffold/main-config
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/main-config
deploy:
kubectl:
manifests:
Expand All @@ -11,7 +11,7 @@ profiles:
- name: oncluster
build:
artifacts:
- image: gcr.io/k8s-skaffold/main-config-pipeline
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/main-config-pipeline
context: .
kaniko: {}
tagPolicy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /secret/kaniko-secret
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-build
resources: {}
volumeMounts:
Expand Down Expand Up @@ -75,7 +75,7 @@ spec:
command:
- skaffold
- deploy
image: gcr.io/k8s-skaffold/skaffold:latest
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold:latest
name: run-deploy
resources: {}
workingDir: /workspace/source
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/helm-render/builds.out.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"builds":[{"imageName":"gcr.io/k8s-skaffold/skaffold-helm","tag":"gcr.io/k8s-skaffold/skaffold-helm:sha256-nonsenselettersandnumbers"}]}
{"builds":[{"imageName":"us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm","tag":"us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm:sha256-nonsenselettersandnumbers"}]}
2 changes: 1 addition & 1 deletion integration/testdata/helm-render/skaffold-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image: gcr.io/k8s-skaffold/skaffold-helm
image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm
# This is the helm convention on declaring images
# image:
# repository: nginx
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/helm-render/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
tagPolicy:
sha256: {}
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-helm
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm
manifests:
helm:
releases:
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/helm/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build:
tagPolicy:
sha256: {}
artifacts:
- image: gcr.io/k8s-skaffold/skaffold-helm
- image: us-central1-docker.pkg.dev/k8s-skaffold/testing/skaffold-helm
deploy:
helm:
releases:
Expand Down
2 changes: 1 addition & 1 deletion integration/testdata/init/compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ version: '3'
services:
compose:
build: .
image: "gcr.io/k8s-skaffold/compose"
image: "us-central1-docker.pkg.dev/k8s-skaffold/testing/compose"
ports:
- "5000:5000"
Loading

0 comments on commit d4369f3

Please sign in to comment.