Skip to content

Commit

Permalink
Add 'large' test qualifier for lit tests (#2671)
Browse files Browse the repository at this point in the history
Some tests fail in forked repo CI since they take just over 60s, thus
requiring something bigger than `small` test size in bazel.

Example, my forked repo:
https://github.com/GleasonK/stablehlo/actions/runs/12329876949/job/34414702213

This PR splits lit tests so that all `testdata` files ending in
`*.large.mlir` will be run with more RAM and timeout.

Closes #2590
  • Loading branch information
GleasonK authored Dec 16, 2024
1 parent 54dafb1 commit 9e0c9e3
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion stablehlo/testdata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,29 @@ RUNFILES_DIR = LITE_CFG_PY.parents[2].absolute().as_posix()''',
tags = ["stablehlo_testdata_tests"],
deps = ["@rules_python//python/runfiles"],
)
for src in glob(["**/*.mlir"])
for src in glob(
["**/*.mlir"],
exclude = ["**/*.large.mlir"],
)
]

# Give large tests more RAM / timeout
[
lit_test(
name = "%s.test" % src,
size = "large",
srcs = [src],
data = [
"lit.cfg.py",
"lit.site.cfg.py",
"//:stablehlo-opt",
"//:stablehlo-translate",
"@llvm-project//llvm:FileCheck",
],
tags = ["stablehlo_testdata_tests"],
deps = ["@rules_python//python/runfiles"],
)
for src in glob(["**/*.large.mlir"])
]

test_suite(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN-DISABLED(#2590, timeout): stablehlo-opt --chlo-pre-serialization-pipeline -inline %s | stablehlo-translate --interpret
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline -inline %s | stablehlo-translate --interpret
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline %s | stablehlo-translate --serialize --target=current | stablehlo-translate --deserialize | stablehlo-opt > %t.0
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline %s > %t.1
// RUN: diff %t.0 %t.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN-DISABLED(#2590, timeout): stablehlo-opt --chlo-pre-serialization-pipeline -inline %s | stablehlo-translate --interpret
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline -inline %s | stablehlo-translate --interpret
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline %s | stablehlo-translate --serialize --target=current | stablehlo-translate --deserialize | stablehlo-opt > %t.0
// RUN: stablehlo-opt --chlo-pre-serialization-pipeline %s > %t.1
// RUN: diff %t.0 %t.1
Expand Down

0 comments on commit 9e0c9e3

Please sign in to comment.