Skip to content

Commit

Permalink
Clean up stakeholders after Import CSV API test
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Lucidi <slucidi@redhat.com>
  • Loading branch information
mansam committed Nov 8, 2023
1 parent 57bb3f0 commit 9a5cd5b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/api/importcsv/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,20 @@ func TestImportCSV(t *testing.T) {

// Delete imported Applications.
for _, apps := range gotApps {
if apps.Owner != nil {
assert.Must(t, Stakeholder.Delete(apps.Owner.ID))
}
for _, contributor := range apps.Contributors {
assert.Must(t, Stakeholder.Delete(contributor.ID))
}
assert.Must(t, Application.Delete(apps.ID))
}

// Delete imported Dependencies.
for _, deps := range gotDeps {
assert.Must(t, Dependency.Delete(deps.ID))
}

})
}
}
1 change: 1 addition & 0 deletions test/api/importcsv/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var (
Client *binding.Client
Application binding.Application
Dependency binding.Dependency
Stakeholder binding.Stakeholder
)

func init() {
Expand Down

0 comments on commit 9a5cd5b

Please sign in to comment.