Skip to content

Commit

Permalink
fixes to false positive structure (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
Szer authored Jul 20, 2024
1 parent 7682298 commit bc4cd2e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/VahterBanBot.Tests/ContainerTestBase.fs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ type VahterTestContainers() =
.WithEnvironment("FLYWAY_USER", "vahter_bot_ban_service")
.WithEnvironment("FLYWAY_PASSWORD", "vahter_bot_ban_service")
.WithCommand("migrate", "-schemas=public")
.WithWaitStrategy(Wait.ForUnixContainer().UntilMessageIsLogged("Successfully applied \d+ migrations"))
.WithWaitStrategy(Wait.ForUnixContainer().AddCustomWaitStrategy(
{ new IWaitUntil with
override this.UntilAsync(container) = task {
let! _ = container.GetExitCodeAsync()
return true
}
}))
.DependsOn(dbContainer)
.Build()

Expand Down Expand Up @@ -111,6 +117,11 @@ type VahterTestContainers() =

// run migrations
do! flywayContainer.StartAsync()
let! out, err = flywayContainer.GetLogsAsync()
if err <> "" then
failwith err
if not (out.Contains "Successfully applied") then
failwith out

// seed some test data
// inserting the only admin users we have
Expand Down
6 changes: 6 additions & 0 deletions src/migrations/V7__false-banned-2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DROP TABLE false_positive_messages;
CREATE TABLE false_positive_messages
(
id BIGINT PRIMARY KEY
REFERENCES banned (id) ON DELETE CASCADE
);

0 comments on commit bc4cd2e

Please sign in to comment.