-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Support injecting system properties into JUnit tests #19348
Conversation
e5bb317
to
6e0efbe
Compare
6e0efbe
to
3fe29bf
Compare
Fixed test classes are running with JUnit |
plugin/trino-hive-hadoop2/src/test/java/io/trino/plugin/hive/TestHiveThriftMetastoreWithS3.java
Show resolved
Hide resolved
I allowed myself to merge #19337 to fix the master branch. |
This PR switched ensureTestNamingConvention to run in JUnit to reduce test setups
@findepi done |
3fe29bf
to
2af5b90
Compare
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.PARAMETER) | ||
public @interface SystemProperty |
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.
nit:
Define as top level class.
This helps Intellij generate imports
(for nested class Intellij strongly prefers OutClass.InnerClass syntax which is all but pretty)
@@ -56,10 +56,10 @@ | |||
import org.intellij.lang.annotations.Language; | |||
import org.junit.jupiter.api.AfterAll; | |||
import org.junit.jupiter.api.BeforeAll; | |||
import org.junit.jupiter.api.Test; |
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.
Separate commit.
Also, just noticed that one of the overrides BaseConnectorTest#ensureTestNamingConvention
, does not have @Test
annotation (actually it has testng's @Test
, but not Junit's @Test
).
As a result, the override won't be called.
Please update BaseConnectorTest.ensureTestNamingConvention
to have additional junit @Test
annotation (but keep testng's for now, since all other test methods are testng's)
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.
When extracting the commit please be so nice to include message from 6858091
For many test classes, this it the last method that is not converted.
For example, runningTestInformationSchemaConnector
with TestNG will
run only this method. Moving this will make tests like
TestInformationSchemaConnector
JUnit-only and improve test overall
time (fewercreateQueryRunner
invocations).Obviously, it can be the first JUnit test method for some other classes,
but
- the train cannot be stopped. We do this sooner or later.
AbstractTestQueries
are already JUnit;BaseConnectorTest
extends
fromAbstractTestQueries
andBaseConnectorTest
are most likely to
most expensive setups, because they create dependant services.
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.
In which order I should add this one? Because in either one one of the commits will be broken on it's own
I'm not sure why we need this. This seems to swap:
for
Is there some non-obvious improvement? If not, I don't see why we need this. |
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'm not sure why we need this complexity
Fixes broken master: