1
0
mirror of https://github.com/google/nomulus synced 2026-01-05 04:56:03 +00:00

Make it possible to ignore comment lines when comparing schemas (#2690)

We now pin to postgreSQL v17 when running tests, which means that minor
version might increase without our intervention. This causes (at least)
the comment in the golden schema to change, and failing the test as a
result.

This PR adds the ability to strip lines that we deem as comment from the
comparison, so we don't have to do trivial upgrades to the gold schema
whenever there's minor version upgrade.
This commit is contained in:
Lai Jiang
2025-02-25 11:58:26 -05:00
committed by GitHub
parent 8fbf363195
commit fb816d7a2c
2 changed files with 17 additions and 2 deletions

View File

@@ -115,6 +115,7 @@ class SchemaTest {
Joiner.on(File.separatorChar).join(MOUNTED_RESOURCE_PATH, DUMP_OUTPUT_FILE));
assertThat(dumpedSchema)
.ignoringLinesThatStartWith("--")
.hasSameContentAs(Resources.getResource("sql/schema/nomulus.golden.sql"));
}