Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,14 @@ protected Path getSourcePath()
{
Path workingDir = Paths.get(System.getProperty("user.dir"));
verify(isDirectory(workingDir), "Working directory is not a directory");
String topDirectoryName = workingDir.getFileName().toString();
switch (topDirectoryName) {
case "trino-tests":
return workingDir;
case "trino":
return workingDir.resolve("testing/trino-tests");
default:
throw new IllegalStateException("This class must be executed from trino-tests or Trino source directory");
if (isDirectory(workingDir.resolve(".git"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should check for existence of .gitignore file instead since that is part of the checked out source.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can have .gitignore at any level within the repo, but .git folder should be only one

// Top-level of the repo
return workingDir.resolve("testing/trino-tests");
}
if (workingDir.getFileName().toString().equals("trino-tests")) {
return workingDir;
}
throw new IllegalStateException("This class must be executed from trino-tests or Trino source directory");
}

private class JoinOrderPrinter
Expand Down