Skip to content

Commit

Permalink
Change the flaky check to use output files
Browse files Browse the repository at this point in the history
This is simpler, accounts for both sql and isolation tests, changes in
included files, and versioned tests.
  • Loading branch information
akuzm committed Nov 10, 2022
1 parent e4ba2bc commit 6ad2824
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/gh_matrix_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,11 @@ def macos_config(overrides):
)
else:
# Check if we need to check for the flaky tests. Determine which test files
# have been changed in the PR.
# have been changed in the PR. The sql files might include other files that
# change independently, and might be .in templates, so it's easier to look
# at the output files. They are also the same for the isolation tests.
p = subprocess.Popen(
f"git diff --name-only {sys.argv[2]} -- '**test/sql/*.sql' '**test/sql/*.sql.in'",
f"git diff --name-only {sys.argv[2]} -- '**expected/*.out'",
stdout=subprocess.PIPE,
shell=True,
)
Expand All @@ -244,7 +246,7 @@ def macos_config(overrides):
file=sys.stderr,
)
sys.exit(1)
tests = []
tests = set()
test_count = 1
for f in output.decode().split("\n"):
print(f)
Expand All @@ -258,28 +260,26 @@ def macos_config(overrides):
)
print("full list:", file=sys.stderr)
print(output, file=sys.stderr)
tests = ""
tests = set()
break
basename = os.path.basename(f)
splitted = basename.split(".")
name = splitted[0]
ext = splitted[-1]
if ext == "in":
if ext == "out":
# Account for the version number.
tests.append(name + "-*")
elif ext == "sql":
tests.append(name)
tests.add(name)
else:
# Should've been filtered out above.
print(f"unknown extension '{ext}' for test file '{f}'", file=sys.stderr)
print(f"unknown extension '{ext}' for test output file '{f}'", file=sys.stderr)
sys.exit(1)

if tests:
m["include"].append(
build_debug_config(
{
"coverage": False,
"installcheck_args": f'TESTS="{" ".join(tests * 20)}"',
"installcheck_args": f'TESTS="{" ".join(list(tests) * 20)}"',
"name": "Flaky Check Debug",
"pg": PG14_LATEST,
"pginstallcheck": False,
Expand Down

0 comments on commit 6ad2824

Please sign in to comment.