File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff 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
258265end
You can’t perform that action at this time.
0 commit comments