Skip to content

Commit

Permalink
fix(rollout-service): new test case for ensuring changed apps produce…
Browse files Browse the repository at this point in the history
… independent events (#2157)

This new test case ensures that when we send a new changed app to the
version controller no previous apps get altered.

Ref: SRX-0F9ZN3
  • Loading branch information
diogo-nogueira-freiheit authored Dec 3, 2024
1 parent 232e174 commit e884341
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions services/rollout-service/pkg/versions/versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,98 @@ func TestVersionClientStream(t *testing.T) {
},
},
},
{
Name: "Only alter deployments in changed apps",
Steps: []step{
{
ChangedApps: &api.GetChangedAppsResponse{
ChangedApps: []*api.GetAppDetailsResponse{
{
Application: &api.Application{
Team: "footeam",
Name: "foo",
Releases: []*api.Release{
{
Version: 1,
SourceCommitId: "00001",
},
},
},
Deployments: map[string]*api.Deployment{
"staging": {
Version: 1,
DeploymentMetaData: &api.Deployment_DeploymentMetaData{
DeployTime: "123456789",
},
},
},
},
},
},
OverviewResponse: testOverview,
ExpectReady: true,
ExpectedEvents: []KuberpultEvent{
{
Environment: "staging",
Application: "foo",
EnvironmentGroup: "staging-group",
Team: "footeam",
Version: &VersionInfo{
Version: 1,
SourceCommitId: "00001",
DeployedAt: time.Unix(123456789, 0).UTC(),
},
},
},
},
{
ChangedApps: &api.GetChangedAppsResponse{
ChangedApps: []*api.GetAppDetailsResponse{
{
Application: &api.Application{
Team: "footeam",
Name: "bar",
Releases: []*api.Release{
{
Version: 1,
SourceCommitId: "00001",
},
},
},
Deployments: map[string]*api.Deployment{
"staging": {
Version: 1,
DeploymentMetaData: &api.Deployment_DeploymentMetaData{
DeployTime: "123456789",
},
},
},
},
},
},
OverviewResponse: testOverview,
ExpectReady: true,
ExpectedEvents: []KuberpultEvent{
{
Environment: "staging",
Application: "bar",
EnvironmentGroup: "staging-group",
Team: "footeam",
Version: &VersionInfo{
Version: 1,
SourceCommitId: "00001",
DeployedAt: time.Unix(123456789, 0).UTC(),
},
},
},
},
{
RecvErr: status.Error(codes.Canceled, "context cancelled"),
CancelContext: true,
},
},
},

{
Name: "Notify for apps that are deleted",
Steps: []step{
Expand Down

0 comments on commit e884341

Please sign in to comment.