Skip to content

Commit d1da834

Browse files
fix broken tests
1 parent f08f46c commit d1da834

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

integration_test/pg/storage_test.exs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ defmodule Ecto.Integration.StorageTest do
130130
{:ok, _} = Postgres.structure_load(tmp_path(), params())
131131

132132
{:ok, _} = Postgres.structure_dump(tmp_path(), [dump_path: dump_path] ++ params())
133-
assert dump == File.read!(dump_path)
133+
assert redact_hashes(dump) == redact_hashes(File.read!(dump_path))
134134
after
135135
drop_database()
136136
end
@@ -248,11 +248,18 @@ defmodule Ecto.Integration.StorageTest do
248248
num = @base_migration + System.unique_integer([:positive])
249249
:ok = Ecto.Migrator.up(PoolRepo, num, Migration, log: false)
250250

251-
assert {"--\n-- PostgreSQL database dump\n--\n\n--" <> _rest, 0} =
251+
assert {"--\n-- PostgreSQL database dump\n--\n\n" <> _rest, 0} =
252252
Postgres.dump_cmd(
253253
["--data-only", "--table", "schema_migrations"],
254254
[],
255255
PoolRepo.config()
256256
)
257257
end
258+
259+
defp redact_hashes(dump_output) do
260+
dump_output
261+
|> String.replace(~r/\\restrict\s+\S+/, "\\restrict <REDACTED>")
262+
|> String.replace(~r/\\unrestrict\s+\S+/, "\\unrestrict <REDACTED>")
263+
|> String.trim()
264+
end
258265
end

0 commit comments

Comments
 (0)