From 6bc7fdbf5a825158169c81ea40f6f002d2f37ddf Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Tue, 26 Nov 2024 21:03:11 +0000 Subject: [PATCH] Add Prism handling for packager tests too Because pipeline_tests handles packager tests differently, we need to add Prism handling for them too. Otherwise, we'll get test conflict errors when `test_corpus_prism`'s pattern covers packager tests. Co-authored-by: Emily Samp --- test/BUILD | 2 ++ test/pipeline_test.bzl | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/test/BUILD b/test/BUILD index e46ae090186..2261b685767 100644 --- a/test/BUILD +++ b/test/BUILD @@ -258,6 +258,8 @@ pipeline_tests( pipeline_tests( "test_corpus_prism", glob([ + # Replace [parser] with other phases to test Prism at that level + # Phases: https://github.com/Shopify/sorbet/blob/prism/docs/internals.md#phases "testdata/parser/**/*.rb", "testdata/parser/**/*.exp", ]), diff --git a/test/pipeline_test.bzl b/test/pipeline_test.bzl index 48aece5d925..74cc9240917 100644 --- a/test/pipeline_test.bzl +++ b/test/pipeline_test.bzl @@ -142,6 +142,14 @@ def pipeline_tests(suite_name, all_paths, test_name_prefix, extra_files = [], ta "disabled": "disabled" in test_name, "isPackage": True, } + + # Tests that run with Prism parser need to have "_prism" appended to their name + # to differentiate them from the tests that run with Sorbet parser. + # The condition here is only for the packager tests + # Other tests are handled below. + if parser == "prism": + test_name = test_name + "_prism" + tests[test_name] = data continue