Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tapas4java committed Aug 3, 2024
1 parent dd975db commit f5da4c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/util/git_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestCloneRemoteRepoToDir(t *testing.T) {
assert.Nil(t, err)
ref, err := repo.Head()
assert.Nil(t, err)
assert.Equal(t, "18cf4c0dbd70d9ca1c1dabc7559c8432bb45228d", ref.Hash().String())
assert.Equal(t, "dd975dbead810b80c1221f62beb51f4cee729618", ref.Hash().String())

// existing
spec.Ref = "v0.4.0"
Expand All @@ -46,7 +46,7 @@ func TestCloneRemoteRepoToDir(t *testing.T) {
assert.Nil(t, err)
ref, err = repo.Head()
assert.Nil(t, err)
assert.Equal(t, "18cf4c0dbd70d9ca1c1dabc7559c8432bb45228d", ref.Hash().String())
assert.Equal(t, "dd975dbead810b80c1221f62beb51f4cee729618", ref.Hash().String())

assert.Nil(t, err)
}
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/docker/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func CleanUpDocker(t *testing.T) {
t.Log("cleaning up docker env")
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
b, err := e2e.RunCommand(ctx, `docker ps -aqf name=localdev-control-plane`, 10*time.Second)
b, err := e2e.RunCommand(ctx, `docker ps -aqf name=adhar-control-plane`, 10*time.Second)
assert.NoError(t, err, fmt.Sprintf("error while listing docker containers: %s, %s", err, b))

conts := strings.TrimSpace(string(b))
Expand Down Expand Up @@ -66,8 +66,8 @@ func testCreate(t *testing.T) {

e2e.TestArgoCDApps(ctx, t, kubeClient, e2e.CorePackages)

argoBaseUrl := fmt.Sprintf("https://argocd.%s:%s", e2e.DefaultBaseDomain, e2e.DefaultPort)
giteaBaseUrl := fmt.Sprintf("https://gitea.%s:%s", e2e.DefaultBaseDomain, e2e.DefaultPort)
argoBaseUrl := fmt.Sprintf("https://%s:%s/argocd", e2e.DefaultBaseDomain, e2e.DefaultPort)
giteaBaseUrl := fmt.Sprintf("https://%s:%s/gitea", e2e.DefaultBaseDomain, e2e.DefaultPort)
e2e.TestCoreEndpoints(ctx, t, argoBaseUrl, giteaBaseUrl)
}

Expand Down Expand Up @@ -108,8 +108,8 @@ func testCreatePort(t *testing.T) {

e2e.TestArgoCDApps(ctx, t, kubeClient, e2e.CorePackages)

argoBaseUrl := fmt.Sprintf("https://argocd.%s:%s", e2e.DefaultBaseDomain, port)
giteaBaseUrl := fmt.Sprintf("https://gitea.%s:%s", e2e.DefaultBaseDomain, port)
argoBaseUrl := fmt.Sprintf("https://%s:%s/argocd", e2e.DefaultBaseDomain, port)
giteaBaseUrl := fmt.Sprintf("https://%s:%s/gitea", e2e.DefaultBaseDomain, port)
e2e.TestCoreEndpoints(ctx, t, argoBaseUrl, giteaBaseUrl)
}

Expand All @@ -134,7 +134,7 @@ func testCustomPkg(t *testing.T) {

e2e.TestArgoCDApps(ctx, t, kubeClient, e2e.CorePackages)

giteaBaseUrl := fmt.Sprintf("https://gitea.%s:%s", e2e.DefaultBaseDomain, e2e.DefaultPort)
giteaBaseUrl := fmt.Sprintf("https://%s:%s/gitea", e2e.DefaultBaseDomain, e2e.DefaultPort)

expectedApps := map[string]string{
"my-app": "argocd",
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestArgoCDEndpoints(ctx context.Context, t *testing.T, baseUrl string) {
err = SendAndParse(ctx, &appResp, httpClient, req)
assert.Nil(t, err, fmt.Sprintf("getting argocd applications: %s", err))

assert.Equal(t, 3, len(appResp.Items), fmt.Sprintf("number of apps do not match: %v", appResp.Items))
assert.Equal(t, 24, len(appResp.Items), fmt.Sprintf("number of apps do not match: %v", appResp.Items))
}

func GetBasicAuth(ctx context.Context, name string) (BasicAuth, error) {
Expand Down

0 comments on commit f5da4c5

Please sign in to comment.