Skip to content
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

Removing a check for infix expression element from specs2 test configuration creation #167

Closed
wants to merge 2 commits into from
Closed

Removing a check for infix expression element from specs2 test configuration creation #167

wants to merge 2 commits into from

Conversation

hmemcpy
Copy link

@hmemcpy hmemcpy commented Nov 27, 2017

Fixes #155
Fixes #168

This pull request removes the check for ScInfixExpr from the test configuration for scala2 (see #155). This fixes a bug that prevents right-clicking and running the individual tests.

This is caused due to the element which is right-clicked will usually be the Literal identifier (i.e. "the test name"). An additional lookup for the parent ScInfixExpr is needed to get the actual test case element. This PR adds this lookup.

In addition, some APIs were tweaked to reduce the dependance on the Scala types.

@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@hmemcpy
Copy link
Author

hmemcpy commented Nov 29, 2017

Ok, this probably relates to the bug #168, relating to the finding of existing configurations. There's a check in BlazeScalaJunitTestClassConfigurationProducer which also checks for ScInfixExpr. I'll investigate more and update the bug with more information.

@hmemcpy
Copy link
Author

hmemcpy commented Nov 29, 2017

@chaoren could you please take a look at this?

@chaoren chaoren self-assigned this Nov 29, 2017
private static String getElementStaticText(PsiElement element) {
return TestConfigurationUtil.getStaticTestNameOrDefault(
element,
null,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ugh, they named the parameter "default". I think it's messing up the IDE.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Oh wow, so that's why the red squiggly :(
I upvoted the issue, let's hope it will be fixed before flying cars :)

@chaoren
Copy link
Collaborator

chaoren commented Nov 30, 2017

Merged internally, now to export to github.

@chaoren chaoren closed this Nov 30, 2017
@ittaiz
Copy link
Member

ittaiz commented Nov 30, 2017 via email

@hmemcpy hmemcpy deleted the specs2-test-configuration-tweaks branch December 3, 2017 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to run specs2 individual test method after running the entire test class
4 participants