Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Clean up stakeholders after Import CSV API test #553

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
}

})
}
}
4 changes: 4 additions & 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 All @@ -24,4 +25,7 @@ func init() {

// Access Dependency directly
Dependency = RichClient.Dependency

// Access Stakeholder directly
Stakeholder = RichClient.Stakeholder
}
Loading