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

Adding support for evaluating watches containing binding variables. #5763

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

jlahoda
Copy link
Contributor

@jlahoda jlahoda commented Apr 2, 2023

When a watch contains a binding variable, it fails to show the value. This patch is trying to fix that - that's the case BINDING_VARIABLE: change.

In addition to this, this patch is trying to:

  • add a test for the change, that will only execute under JDK 17.
  • run debugger.jpda tests on JDK 11 and JDK 17
  • disabling tests that failed for me locally - I used a fairly coarse way to disable them, so that e.g. in EvaluationTest, only one subtest fails. This could, presumably, be improved in further patches. IMO better to run some tests, than none.
  • the info.getCompilationUnit() -> treePath.getCompilationUnit() change is a bit tricky: if scanning is running, the TreePath may originate in a different javac instance than is the one held in info. Which then leads to end position -1 (because the end position is held into CompilationUnitTree, but only for trees under that top-level tree), which will inject code at incorrect place. Using treePath.getCompilationUnit() is not 100% correct, I think, but it workarounds the issue at this specific place, at least

^Add meaningful description above

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

@jlahoda jlahoda requested review from mbien and entlicher April 2, 2023 10:02
@mbien mbien added the Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) label Apr 2, 2023
@apache apache locked and limited conversation to collaborators Apr 2, 2023
@apache apache unlocked this conversation Apr 2, 2023
@mbien mbien added this to the NB18 milestone Apr 2, 2023
Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

hi @jlahoda, it is always nice to see more tests getting hooked into CI. Thanks!

the java-modules job has a section which runs a some debugger tests, this job is already very long (~50mins). Assuming the tests work on JDK 17 too, we could move them to the new job you created if you want:

# - name: debugger.jpda
# run: ant $OPTS -f java/debugger.jpda test
- name: debugger.jpda.js
run: ant $OPTS -f java/debugger.jpda.js test
- name: debugger.jpda.projects
run: ant $OPTS -f java/debugger.jpda.projects test
- name: debugger.jpda.projectsui
run: ant $OPTS -f java/debugger.jpda.projectsui test
# - name: debugger.jpda.truffle
# run: ant $OPTS -f java/debugger.jpda.truffle test
# - name: debugger.jpda.ui
# run: ant $OPTS -f java/debugger.jpda.ui test

and

- name: api.debugger.jpda
run: ant $OPTS -f java/api.debugger.jpda test

-> to new java-debugger job

This would have all debugging tests in one job and also help balancing job length a bit.

@mbien
Copy link
Member

mbien commented Apr 2, 2023

tests are now failing. The reason it didn't fail the first time it ran is because -Dtest.config= was set to an empty String, so nothing did actually run.

@mbien
Copy link
Member

mbien commented Apr 2, 2023

I am sorry, I forgot something. The job handle would have to be added to the list at:

# last job depends on everything so that it is forced to run last even if a long job fails early
cleanup:
name: Cleanup Workflow Artifacts
needs:
- base-build
- linux-commit-validation

so that the pipeline artifact is not cleaned up when the new job fails (allows restarts).

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

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

thanks. Looks good to me.

@mbien
Copy link
Member

mbien commented Apr 12, 2023

@jlahoda do you think this is good to merge or should we wait for another review? Don't forget to squash before merge.

@mbien
Copy link
Member

mbien commented Apr 15, 2023

@jlahoda features freeze for NB18 is on the 18th. Ideally all PRs should be merged till Monday night or they will be bumped to NB19.

@jlahoda jlahoda force-pushed the evaluate-binding-variable branch from 6e3b91f to b2de439 Compare April 15, 2023 20:44
@mbien
Copy link
Member

mbien commented Apr 15, 2023

thank you :)
all green -> merging

@mbien mbien merged commit 9f50632 into apache:master Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants