Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh committed Feb 27, 2024
1 parent f9054cb commit e34c252
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 66 deletions.
7 changes: 3 additions & 4 deletions controller/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,20 +646,19 @@ func TestCompareAppStateWithManifestGeneratePath(t *testing.T) {

data := fakeData{
manifestResponse: &apiclient.ManifestResponse{
Manifests: []*apiclient.Manifest{}{},
Manifests: []*apiclient.Manifest{},
Namespace: test.FakeDestNamespace,
Server: test.FakeClusterURL,
Revision: "abc123",
},
updateRevisionForPathsResponse: &apiclient.UpdateRevisionForPathsResponse{},
}

ctrl := newFakeController(&data, nil)
ctrl := newFakeController(&data)
revisions := make([]string, 0)
revisions = append(revisions, "abc123")
compRes, err := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, app.Spec.GetSources(), false, false, nil, false)
compRes := ctrl.appStateManager.CompareAppState(app, &defaultProj, revisions, app.Spec.GetSources(), false, false, nil, false)

assert.Nil(t, err)
assert.NotNil(t, compRes)
assert.Equal(t, argoappv1.SyncStatusCodeSynced, compRes.syncStatus.Status)
assert.Equal(t, "abc123", compRes.syncStatus.Revision)
Expand Down
92 changes: 43 additions & 49 deletions reposerver/apiclient/mocks/RepoServerServiceClient.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions server/application/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ func (s *Server) StartEventSource(es *events.EventSource, stream events.Eventing
{
logCtx.Infof("OnAdd channel size is %d", len(onAddEventsChannel))
logAppEvent := logCtx.WithFields(log.Fields{
"app": event.Application.Name,
"type": event.Type,
"app": event.Application.Name,
"type": event.Type,
})
logAppEvent.Infof("Received application added event")
err = s.processEvent(event, logAppEvent, stream, sendIfPermitted)
Expand All @@ -1171,8 +1171,8 @@ func (s *Server) StartEventSource(es *events.EventSource, stream events.Eventing
{
logCtx.Infof("OnDelete channel size is %d", len(onDeleteEventsChannel))
logAppEvent := logCtx.WithFields(log.Fields{
"app": event.Application.Name,
"type": event.Type,
"app": event.Application.Name,
"type": event.Type,
})
logAppEvent.Infof("Received application deleted event")
err = s.processEvent(event, logAppEvent, stream, sendIfPermitted)
Expand All @@ -1184,8 +1184,8 @@ func (s *Server) StartEventSource(es *events.EventSource, stream events.Eventing
{
logCtx.Infof("OnUpdate channel size is %d", len(onUpdateEventsChannel))
logAppEvent := logCtx.WithFields(log.Fields{
"app": event.Application.Name,
"type": event.Type,
"app": event.Application.Name,
"type": event.Type,
})
logAppEvent.Infof("Received application update event")
err = s.processEvent(event, logAppEvent, stream, sendIfPermitted)
Expand All @@ -1197,8 +1197,8 @@ func (s *Server) StartEventSource(es *events.EventSource, stream events.Eventing
{
logCtx.Infof("All events channel size is %d", len(allEventsChannel))
logAppEvent := logCtx.WithFields(log.Fields{
"app": event.Application.Name,
"type": event.Type,
"app": event.Application.Name,
"type": event.Type,
})
logAppEvent.Infof("Received application event")
err = s.processEvent(event, logAppEvent, stream, sendIfPermitted)
Expand Down
8 changes: 4 additions & 4 deletions server/application/application_event_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ func TestGetApplicationLatestRevision(t *testing.T) {
Revision: appRevision,
},
History: []v1alpha1.RevisionHistory{
v1alpha1.RevisionHistory{
{
Revision: history1Revision,
},
v1alpha1.RevisionHistory{
{
Revision: history2Revision,
},
},
Expand Down Expand Up @@ -187,10 +187,10 @@ func TestGetLatestAppHistoryId(t *testing.T) {
appMock := v1alpha1.Application{
Status: v1alpha1.ApplicationStatus{
History: []v1alpha1.RevisionHistory{
v1alpha1.RevisionHistory{
{
ID: history1Id,
},
v1alpha1.RevisionHistory{
{
ID: history2Id,
},
},
Expand Down
2 changes: 1 addition & 1 deletion server/application/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ func TestNoAppEnumeration(t *testing.T) {
_, err = appServer.GetApplicationSyncWindows(adminCtx, &application.ApplicationSyncWindowsQuery{Name: pointer.String("doest-not-exist"), Project: pointer.String("test")})
assert.Equal(t, "rpc error: code = NotFound desc = applications.argoproj.io \"doest-not-exist\" not found", err.Error(), "when the request specifies a project, we can return the standard k8s error message")
})

t.Run("WatchResourceTree", func(t *testing.T) {
err := appServer.WatchResourceTree(&application.ResourcesQuery{ApplicationName: pointer.String("test")}, &TestResourceTreeServer{ctx: adminCtx})
assert.NoError(t, err)
Expand Down
1 change: 1 addition & 0 deletions util/git/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func Test_ChangedFiles(t *testing.T) {

// Not SHAs, error
_, err = client.ChangedFiles(previousSHA, "HEAD")
require.Error(t, err)

// Same commit, no changes
changedFiles, err := client.ChangedFiles(commitSHA, commitSHA)
Expand Down

0 comments on commit e34c252

Please sign in to comment.