Skip to content

Commit

Permalink
Resolve RequireByString test suite failures on Ubuntu CI (#1124)
Browse files Browse the repository at this point in the history
This PR resolves the RequireByString test suite failures in CI on
Ubuntu. The issue was that paths on linux are case sensitive and thus
MacOS/Windows machines simply behaved as if the paths to the test files
were case-insensitive, but the linux machine was unable to find the test
files. Those tests were `#ifdef'd` out, and have been un `#ifdef'd` to
demonstrate these changes work.
  • Loading branch information
Vighnesh-V authored Dec 5, 2023
1 parent aafea36 commit 2ea7193
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/RequireByString.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,20 @@ class ReplWithPathFixture

for (int i = 0; i < 20; ++i)
{
if (isDirectory(luauDirAbs + "/Luau/tests") || isDirectory(luauDirAbs + "/Client/Luau/tests"))
bool engineTestDir = isDirectory(luauDirAbs + "/Client/Luau/tests");
bool luauTestDir = isDirectory(luauDirAbs + "/luau/tests");
if (engineTestDir || luauTestDir)
{
if (isDirectory(luauDirAbs + "/Client/Luau/tests"))
if (engineTestDir)
{
luauDirRel += "/Client";
luauDirAbs += "/Client";
luauDirRel += "/Client/Luau";
luauDirAbs += "/Client/Luau";
}
else
{
luauDirRel += "/luau";
luauDirAbs += "/luau";
}
luauDirRel += "/Luau";
luauDirAbs += "/Luau";

if (type == PathType::Relative)
return luauDirRel;
Expand Down Expand Up @@ -209,7 +214,6 @@ TEST_CASE("PathNormalization")
}
}

#if 0

TEST_CASE_FIXTURE(ReplWithPathFixture, "RequireSimpleRelativePath")
{
Expand Down Expand Up @@ -390,6 +394,4 @@ TEST_CASE_FIXTURE(ReplWithPathFixture, "RequirePathWithParentAlias")
assertOutputContainsAll({"true", "result from other_dependency"});
}

#endif

TEST_SUITE_END();

0 comments on commit 2ea7193

Please sign in to comment.