-
Notifications
You must be signed in to change notification settings - Fork 233
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
refactor: remove getTestName from IRTests.java so tests do not rely on method name #1485
base: master
Are you sure you want to change the base?
Conversation
Test Results 827 files ± 0 827 suites ±0 4h 29m 15s ⏱️ - 22m 14s Results for commit 520e80e. ± Comparison against base commit 90350c7. This pull request removes 59 and adds 160 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@msridhar @juliandolby Hey whenever you get a chance could I get review on this, thank you! |
@jkhaliqi I love it! Do you have time to take this further? This is the key function that pulls out the name of the currently-running test: WALA/cast/java/src/testFixtures/java/com/ibm/wala/cast/java/test/IRTests.java Lines 357 to 366 in 90350c7
I'd love it if we could push this cleanup further so that the function above could just be deleted and everywhere we rely on it we instead use parameterized tests. I think it would involve a few more changes similar to what you've already done and (hopefully!) deleting a bunch of code. What do you think? |
Hey sounds good, and thank you! I'll give that a try and see how far I get |
"VarargsOverriding", | ||
"EnumSwitch", | ||
"OverridesOnePointFour", | ||
"VarargsCovariant", | ||
"SimpleEnums", | ||
"GenericSuperSink", | ||
"AnonGeneNullarySimple", | ||
"AnonymousGenerics", | ||
"NotSoSimpleEnums", | ||
"Varargs", | ||
"GenericArrays", | ||
"Annotations", | ||
"Cocovariant", | ||
"ExplicitBoxingTest", | ||
"Wildcards", | ||
"BasicsGenerics", | ||
"CustomGenericsAndFields", | ||
"TypeInferencePrimAndStringOp", | ||
"SimpleEnums2", | ||
"GenericMemberClasses", | ||
"MoreOverriddenGenerics"); |
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.
If the order of these items does not matter, then please sort them alphabetically. That will make this list easier to scan when adding new items, easier to avoid adding duplicates, etc..
d1483aa
to
ffbd13b
Compare
@jkhaliqi is this ready for review? |
@msridhar Yup, I believe this is ready for review, whenever you get a chance, thank you! |
ffbd13b
to
2eb871e
Compare
I just changed the JavaIRTests to be alphabetical as well for parametrized tests, but all should be good now! |
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.
Looking great! A couple of comments particularly on JavaIRTests
true, | ||
null); | ||
} | ||
static List<? extends IRAssertion> caForInterfaceTest1 = |
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.
This naming scheme caForXXX
is confusing. What does ca
mean? Can we use something more descriptive?
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 wasn't exactly sure what ca
also meant I got this variable name from the fourth parameter inside of runTests
. But i'm assuming it has something to do with the callGraph
and just changed it to be callAssertionsForXXX
. Let me know if theres a better name.
} | ||
|
||
@Test | ||
public void testArrayLiteral2() throws IllegalArgumentException, CancelException, IOException { | ||
public void testTwoClasses() throws IllegalArgumentException, CancelException, IOException { |
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.
Why are the remaining tests still here and not just run via the parameterized 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.
Some of the remaining tests call runTests and store its output in a variable and then do other stuff with it so I just left those alone.
2eb871e
to
853fdb6
Compare
853fdb6
to
520e80e
Compare
@jkhaliqi can you just add commits to your branch from now on instead of force pushing? That will make it easier to see what is changing. I will squash the commits before merging. |
@msridhar Sounds good, sorry about that! |
Cleaned up
ECJJava15IRTest.java
by refactoring the tests to be parameterized to not rely on method name for running the tests. Also removed thegetTestName
fromIRTests
so the tests do not rely on that method to get the name of the test it should run. With this we pass in the name and tests can now be parameterized as well instead of relying on naming tests differently