Skip to content

Commit

Permalink
Merge branch 'feat/argocd-app-history' of https://github.com/Mangaal/…
Browse files Browse the repository at this point in the history
…argo-cd into feat/argocd-app-history
  • Loading branch information
Mangaal committed Mar 14, 2024
2 parents 3f05e52 + 12bb9f7 commit f14c3f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions cmd/argocd/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -2496,12 +2496,11 @@ func printApplicationHistoryTable(revHistory []argoappv1.RevisionHistory) {
}
}
for source, historyEntries := range varHistory {
_, _ = fmt.Fprintf(w, "SOURCE\t%s\n", source)
_, _ = fmt.Fprintf(w, "\nSOURCE\t%s\n", source)
_, _ = fmt.Fprintf(w, "ID\tDATE\tREVISION\n")
for _, history := range historyEntries {
_, _ = fmt.Fprintf(w, "%d\t%s\t%s\n", history.id, history.date, history.revision)
}
_, _ = fmt.Fprintf(w, "\n")
}
_ = w.Flush()
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/argocd/commands/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ func TestPrintApplicationHistoryTable(t *testing.T) {
return nil
})

expectation := "SOURCE test\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1\n2 0001-01-01 00:00:00 +0000 UTC 2\n3 0001-01-01 00:00:00 +0000 UTC 3\n\n"
expectation := "\nSOURCE test\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1\n2 0001-01-01 00:00:00 +0000 UTC 2\n3 0001-01-01 00:00:00 +0000 UTC 3\n"

if output != expectation {
t.Fatalf("Incorrect print operation output %q, should be %q", output, expectation)
Expand Down Expand Up @@ -648,7 +648,7 @@ func TestPrintApplicationHistoryTableWithMultipleSources(t *testing.T) {
return nil
})

expectation := "SOURCE test-1\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1a\n2 0001-01-01 00:00:00 +0000 UTC 2a\n3 0001-01-01 00:00:00 +0000 UTC 3a\n\nSOURCE test-2\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1b\n2 0001-01-01 00:00:00 +0000 UTC 2b\n3 0001-01-01 00:00:00 +0000 UTC 3b\n\n"
expectation := "\nSOURCE test-1\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1a\n2 0001-01-01 00:00:00 +0000 UTC 2a\n3 0001-01-01 00:00:00 +0000 UTC 3a\n\nSOURCE test-2\nID DATE REVISION\n1 0001-01-01 00:00:00 +0000 UTC 1b\n2 0001-01-01 00:00:00 +0000 UTC 2b\n3 0001-01-01 00:00:00 +0000 UTC 3b\n"

if output != expectation {
t.Fatalf("Incorrect print operation output %q, should be %q", output, expectation)
Expand Down

0 comments on commit f14c3f1

Please sign in to comment.