-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infer test group name directly from test file path #3418
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Let's bring this to the team for some feedback too. We shall make this as the new convention.
test/test_runner/test_parser.cpp
Outdated
@@ -67,8 +79,6 @@ void TestParser::parseHeader() { | |||
break; | |||
} | |||
case TokenType::GROUP: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need TokenType::GROUP
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it in for the sake of backward compatibility. We can remove it if we want to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just remove it then.
test/test_runner/test_parser.cpp
Outdated
std::size_t subEnd = path.find_last_of('.') - 1; | ||
std::string relPath = path.substr(subStart, subEnd - subStart + 1); | ||
std::replace(relPath.begin(), relPath.end(), '-', '_'); | ||
std::replace(relPath.begin(), relPath.end(), '/', '|'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm will this replace work on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added another replace line for windows backslash. Also had to change delimiter since windows does not support |
test/test_runner/test_parser.cpp
Outdated
1; | ||
std::size_t subEnd = path.find_last_of('.') - 1; | ||
std::string relPath = path.substr(subStart, subEnd - subStart + 1); | ||
std::replace(relPath.begin(), relPath.end(), '-', '_'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should replace -
with _
. Users of the testing framework should follow the convention of using _
instead of -
in file/dir names themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this as a workaround as a bunch of files/directories had -
in the codebase which results in a false positive during the test runs. I could also go and change those files and remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do u mean "false positive" here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this line and fixed the naming of existing tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can u also update the docs now regarding to the changes on test group name?
test/test_runner/test_parser.cpp
Outdated
@@ -67,8 +79,6 @@ void TestParser::parseHeader() { | |||
break; | |||
} | |||
case TokenType::GROUP: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just remove it then.
Also, can u revisit the false positive issue? We'd better understand what's acceptable directory and file naming conventions under |
06c8432
to
83aa526
Compare
Test Group Name Generation
-GROUP
property is not removed for backward compatibility (is this necessary?)Note: some characters such as : and - result in tests not being actually run (some current test cases are like this)
![image](https://private-user-images.githubusercontent.com/67709970/327565014-6d5049da-a244-42ff-b7e7-4a62bad36781.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzODgwMzYsIm5iZiI6MTcyMDM4NzczNiwicGF0aCI6Ii82NzcwOTk3MC8zMjc1NjUwMTQtNmQ1MDQ5ZGEtYTI0NC00MmZmLWI3ZTctNGE2MmJhZDM2NzgxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDIxMjg1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjNTExZDgwODcwOWRhYmI3NjBjZTRkNjFiOTk0MjZmZjM1N2Y1YzNjNTIxZWZiMGMxYzJmMzJmNzAwNWU4ZjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WEuQg5lcREEqRhh1wXgvSU_gQX3-pe5ZNEyU7GNK-KM)
Example
the file
test/test_files/tck/match/match8
now has test group nametck~match~match8
Todo
delete
-GROUP
from all existing test files (do we want to do this?)