-
Notifications
You must be signed in to change notification settings - Fork 14
add message checking to integration tests #136
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
Conversation
Had a quick look and the idea looks good to me. Could you please resolve the conflict? |
36e73b5
to
21aef0c
Compare
@jdneo Done |
21aef0c
to
593001e
Compare
rebased |
...c/test/java/com/microsoft/java/bs/core/internal/server/BuildTargetServerIntegrationTest.java
Outdated
Show resolved
Hide resolved
593001e
to
4566a7b
Compare
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.
LGTM
Thank you @Arthurm1! |
CompileResult compileResult = gradleBuildServer.buildTargetCompile(compileParams).join(); | ||
assertEquals(StatusCode.OK, compileResult.getStatusCode()); | ||
client.waitOnMessages(2, 2, 1); | ||
BuildTargetIdentifier testBt = getBt(btIds, "/junit5-jupiter-starter-gradle/", "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.
@Arthurm1 Does this case pass on your side? Due to the current implementation at:
Lines 121 to 126 in 59b80ec
// Note: this might be anti-sepc, because the spec limits that one compile task report | |
// can only have one build target id. While we aggregate all compile related tasks into one | |
// Gradle call for the perf consideration. So, the build target id passed into the reporter | |
// is not accurate. | |
TaskProgressReporter reporter = new TaskProgressReporter( | |
new CompileProgressReporter(client, btIds.iterator().next())); |
It fails on my machine, but I have no idea why it passes in GitHub Actions.
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.
@jdneo Yes it passes on mine. What line does it fail on - 324? The messages I have at that point are...
It's possible you have additional messages. I noticed that the CompletableFuture.runAsync(this::reloadWorkspace);
triggered after a compile will cause more messages to be sent to the client but that's normally too slow to register. I have fix for this and can submit a PR, but it's only ever happened to me when I've sat on a breakpoint for a while.
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 suspect this limitation causes the failure:
Target id for both main
and test
are sent to be compiled, and the task classes
and testClasses
are executed in one invocation. But because of
Line 126 in 59b80ec
new CompileProgressReporter(client, btIds.iterator().next())); |
only main
target id is set to the compile reporter, which fails line 326?
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.
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.
Cool! We can eliminate a protocol violation then. I'll review it these days. Thank you!
Currently the integration tests only handle direct replies to BSP messages e.g.
workspace/buildTargets
returnsWorkspaceBuildTargetsResult
This PR allows monitoring of async messages e.g.
build/taskProgress
and adds tests for these.It's the first step in testing progress reports per build target and eventually diagnostic reports.
It also gets rid of the global
Launcher.client
which I think is a good thing.Also fixed: the
onBuildTaskProgress
notification has acompile-task
data kind sodata
must contain aCompileTask