forked from argoproj/argo-cd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes git client to resolve semantic versioning tags (argopro…
…j#17566) * feat: changes git client to resolve semantic versioning tags Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * docs: update documentation Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * feat: simplify `resolveSemverRevision` method Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * chore: add two more test cases Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * chore: update `resolveSemverRevision` behavior Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * chore: add end to end test Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * chore: fix end to end test Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> * chore: improve semver constraint e2e testing Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> --------- Signed-off-by: Pablo Aguilar <pablo.aguilar@outlook.com.br> Signed-off-by: rumstead <37445536+rumstead@users.noreply.github.com>
- Loading branch information
1 parent
236eb95
commit e70af7a
Showing
4 changed files
with
215 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package e2e | ||
|
||
import ( | ||
"strings" | ||
"testing" | ||
|
||
"github.com/argoproj/argo-cd/v2/test/e2e/fixture" | ||
v1 "k8s.io/api/core/v1" | ||
|
||
. "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" | ||
. "github.com/argoproj/argo-cd/v2/test/e2e/fixture/app" | ||
) | ||
|
||
func TestGitSemverResolutionNotUsingConstraint(t *testing.T) { | ||
Given(t). | ||
Path("deployment"). | ||
CustomSSHKnownHostsAdded(). | ||
SSHRepoURLAdded(true). | ||
RepoURLType(fixture.RepoURLTypeSSH). | ||
Revision("v0.1.0"). | ||
When(). | ||
AddTag("v0.1.0"). | ||
CreateApp(). | ||
Sync(). | ||
Then(). | ||
Expect(SyncStatusIs(SyncStatusCodeSynced)) | ||
} | ||
|
||
func TestGitSemverResolutionUsingConstraint(t *testing.T) { | ||
Given(t). | ||
Path("deployment"). | ||
CustomSSHKnownHostsAdded(). | ||
SSHRepoURLAdded(true). | ||
RepoURLType(fixture.RepoURLTypeSSH). | ||
Revision("v0.1.*"). | ||
When(). | ||
AddTag("v0.1.0"). | ||
CreateApp(). | ||
Sync(). | ||
Then(). | ||
Expect(SyncStatusIs(SyncStatusCodeSynced)). | ||
When(). | ||
PatchFile("deployment.yaml", `[ | ||
{"op": "replace", "path": "/metadata/name", "value": "new-app"}, | ||
{"op": "replace", "path": "/spec/replicas", "value": 1} | ||
]`). | ||
AddTag("v0.1.2"). | ||
Sync(). | ||
Then(). | ||
Expect(SyncStatusIs(SyncStatusCodeSynced)). | ||
Expect(Pod(func(p v1.Pod) bool { return strings.HasPrefix(p.Name, "new-app") })) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters