Skip to content

Micronaut launcher tests#8293

Merged
MartinBalin merged 1 commit intoapache:masterfrom
petrovic-d:micronaut-launcher-tests
Apr 16, 2025
Merged

Micronaut launcher tests#8293
MartinBalin merged 1 commit intoapache:masterfrom
petrovic-d:micronaut-launcher-tests

Conversation

@petrovic-d
Copy link
Copy Markdown
Collaborator

Micronaut launcher tests that are testing commands exposed through code lenses - nbls.run.single (run and run in dev mode) and nbls.debug.single

@petrovic-d petrovic-d self-assigned this Mar 4, 2025
@apache apache locked and limited conversation to collaborators Mar 4, 2025
@apache apache unlocked this conversation Mar 4, 2025
@petrovic-d petrovic-d force-pushed the micronaut-launcher-tests branch 3 times, most recently from ad6f973 to 7a1e444 Compare March 4, 2025 13:24
const verifyConditionCallback = (value: string) => new RegExp(/.*/.source + MAVEN_COMMAND_REGEX.source + /.*/.source + MAVEN_PLUGIN_RUN_REGEX.source).test(value);
const errorMessageCallback = (value: string) => `Output: ${value} doesn't contain exec-maven-plugin:exec command`;

myExtension.debugConsoleListeners.push({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please pass the listener instance to the callback; right now the topmost listener is cleared whatever it is. Also please clean the listener in a case that the launch process gets stuck and the listener never receives isMavenCommand().
Maybe listeners [] can be cleared in an afterEach() Mocha handler.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Not sure what to you mean by pass the listener instance to the callback

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure what to you mean by pass the listener instance to the callback

Sorry; in the ad6f973 version, the createDebugConsoleEventCallback pop-ed the last listener whatever it was. It would be more reliable if the listener actually registered by the test was pop-ed.

clearDebugConsoleListeners() solves it other way.

Comment thread java/java.lsp.server/vscode/src/extension.ts Outdated
@sdedic sdedic added this to the NB26 milestone Mar 24, 2025
@petrovic-d petrovic-d force-pushed the micronaut-launcher-tests branch from 7a1e444 to 86bb663 Compare March 24, 2025 09:23
@petrovic-d petrovic-d requested a review from sdedic March 24, 2025 09:27
@petrovic-d petrovic-d force-pushed the micronaut-launcher-tests branch from 86bb663 to 8e0a980 Compare April 1, 2025 12:42
Copy link
Copy Markdown
Member

@sdedic sdedic left a comment

Choose a reason for hiding this comment

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

Looks good. Not needed at the moment (for the current usage in tests), but consider passing some bit of context, i.e. DebugSession to the DebugConsoleListener callback: now the tracker attaches Adapter to each DebugSession, but the info which debug session produces the message is lost before the output reach registered listeners.

@neilcsmith-net neilcsmith-net modified the milestones: NB26, NB27 Apr 16, 2025
@MartinBalin MartinBalin merged commit 2980e1b into apache:master Apr 16, 2025
32 checks passed
@ebarboni ebarboni modified the milestones: NB27, NB26 Apr 16, 2025
@ebarboni
Copy link
Copy Markdown
Contributor

fixing milestone as not yet branched

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants