Repository navigation
Fix the integration tests checkstyles. - #1149
Conversation
| distribution: 'temurin' | ||
|
|
||
| - name: Compile integration tests to verify compilation and checkstyle issues. | ||
| run: build/sbt integrationTests/compile |
There was a problem hiding this comment.
Since we don't run integrationTests when build/sbt test, so usually we don't add the integrationTests module in the root here. https://github.com/unitycatalog/unitycatalog/pull/1149/files#diff-5634c415cd8c8504fdb973a3ed092300b43c4b8fc1e184f7249eb29a55511f91R661
But we still need to verify the integrationTests's checkstyle and compilation issues when running CI .
c64a464 to
ae50960
Compare
| javafmtCheckSettings, | ||
| javaCheckstyleSettings("dev/checkstyle-config.xml"), | ||
| // Since integrationTests don't have main sources, so checking the test code when compiling. | ||
| (Compile / compile) := ((Test / compile) dependsOn testJavastyle).value, |
There was a problem hiding this comment.
@tdas , this line is the key change to enable the checkstyle. Since the integrationTests module does not have the main java source code, so the ./build/sbt compile won't do any checkstyle check.
Also we usually don't run ./build/sbt test for integrationTests module, since integrationTests is not a module that will be triggered for every PR changes. Then we have no change to enforce the checkstyle check for integrationTests.
Here we just make the compile depends on the integrationTests's Test/compile --- (just compile the test code, not run it). Then we can successfully dectect the invalidation.
There was a problem hiding this comment.
And the ./build/sbt compile won't check it also, the correct command to check it is: ./build/sbt integrationTest/compile. That's why I made this change in Github CI.
70b4bbd to
5ea0374
Compare
| distribution: 'temurin' | ||
|
|
||
| - name: Compile integration tests to verify compilation and checkstyle issues. | ||
| run: build/sbt integrationTests/test:compile |
There was a problem hiding this comment.
Use the command to build the integrationTests which is included in the sbt's root .
There was a problem hiding this comment.
can you add this after the main tests have run?
There was a problem hiding this comment.
alternatively... why not add integrationTests to the root so that its always compiled like other modules?
There was a problem hiding this comment.
alternatively... why not add integrationTests to the root so that its always compiled like other modules?
Because we don't expect the integrationTests to be run if we do ./build/sbt test, rigtht ?
There was a problem hiding this comment.
thats a good point. we dont want any one to run the integration test with the simple command of sbt test.
then i am okay with integration test being outside the root. please add a comment in the build file saying the reason why.
and then this github workflow can test the integration tests.
There was a problem hiding this comment.
Sounds good to me, let me add the context. I think it will better to have it in the first step, so that it won't waste resource to run all unit tests if there is any compliation error or checkstyle issue in integrationTests module.
| @@ -1,85 +1,91 @@ | |||
| package io.unitycatalog.integrationtests; | |||
|
|
|||
| import lombok.Getter; | |||
There was a problem hiding this comment.
Those are just code reformat, to match the checkstyle rules.
| @@ -1,5 +1,10 @@ | |||
| package io.unitycatalog.integrationtests; | |||
|
|
|||
| import static java.lang.String.format; | |||
There was a problem hiding this comment.
Those are checkstyles alignments.
| @@ -1,5 +1,11 @@ | |||
| package io.unitycatalog.integrationtests; | |||
|
|
|||
| import static java.lang.String.format; | |||
| run: build/sbt integrationTests/test:compile | ||
|
|
||
| - name: Run tests with coverage | ||
| run: build/sbt -J-Xmx2G +jacoco |
There was a problem hiding this comment.
i feel something is horribly wrong here. what is running tests in this command?
There was a problem hiding this comment.
I think it just run all unit tests under the sbt's root project here.
The jacoco says:
+jacoco
The + is a cross-building operator in SBT. It tells SBT to run the task for all crossScalaVersions defined in the project. For example, if your project supports Scala 2.13 and 3.3, it will run the task for both.
jacoco is likely a custom SBT task added via a plugin (usually the sbt-jacoco plugin
) for code coverage reporting.
Jacoco measures test coverage for your code.
Running +jacoco will compile, run tests, and generate coverage reports for all Scala versions your project supports
There was a problem hiding this comment.
I think, here we can just use the ./build/sbt -J-Xmx2G test.
| javaOptions ++= Seq( | ||
| "--add-exports=java.base/sun.nio.ch=ALL-UNNAMED", | ||
| ), | ||
| javafmtCheckSettings, |
There was a problem hiding this comment.
why not add integrationTests to the root as well?
wouldnt that solve a lot of the problems?
There was a problem hiding this comment.
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
Signed-off-by: Zheng Hu <[email protected]>
4b2d597 to
a292f8c
Compare
|
The test is still failing... [error] Test io.unitycatalog.cli.table.CliTableCRUDTest.testTableCRUD failed: java.lang.RuntimeException: io.unitycatalog.client.ApiException: java.io.IOException: closed, took 11.3s
[error] at io.unitycatalog.cli.UnityCatalogCli.main(UnityCatalogCli.java:171)
[error] at io.unitycatalog.cli.TestUtils.executeCLICommand(TestUtils.java:24)
[error] at io.unitycatalog.cli.table.CliTableOperations.listTables(CliTableOperations.java:70)
[error] at io.unitycatalog.server.base.table.BaseTableCRUDTest.verifyTablePagination(BaseTableCRUDTest.java:115)
[error] at io.unitycatalog.server.base.table.BaseTableCRUDTest.testTableCRUD(BaseTableCRUDTest.java:72)
[error] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[error] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] at java.lang.reflect.Method.invoke(Method.java:569)
[error] ...
[error] Caused by: io.unitycatalog.client.ApiException: java.io.IOException: closed
[error] at io.unitycatalog.client.api.TablesApi.listTablesWithHttpInfo(TablesApi.java:428)
[error] at io.unitycatalog.client.api.TablesApi.listTables(TablesApi.java:393)
[error] at io.unitycatalog.cli.TableCli.listTables(TableCli.java:145)
[error] at io.unitycatalog.cli.TableCli.handle(TableCli.java:45)
[error] at io.unitycatalog.cli.UnityCatalogCli.main(UnityCatalogCli.java:136)
[error] ... 76 more
[error] Caused by: java.io.IOException: closed
[error] at jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream.current(ResponseSubscribers.java:448)
[error] at jdk.internal.net.http.ResponseSubscribers$HttpResponseInputStream.read(ResponseSubscribers.java:503)
[error] at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.ensureLoaded(ByteSourceJsonBootstrapper.java:547)
[error] at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.detectEncoding(ByteSourceJsonBootstrapper.java:137)
[error] at com.fasterxml.jackson.core.json.ByteSourceJsonBootstrapper.constructParser(ByteSourceJsonBootstrapper.java:266)
[error] at com.fasterxml.jackson.core.JsonFactory._createParser(JsonFactory.java:1874)
[error] at com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1273)
[error] at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3913)
[error] at io.unitycatalog.client.api.TablesApi.listTablesWithHttpInfo(TablesApi.java:423)
[error] ... 80 more
[error] Caused by: java.net.ProtocolException: protocol error: Frame type(108) length(7102818) exceeds MAX_FRAME_SIZE(16384)
[error] at jdk.internal.net.http.Http2Connection.protocolError(Http2Connection.java:1229)
[error] at jdk.internal.net.http.Http2Connection.processFrame(Http2Connection.java:833)
[error] at jdk.internal.net.http.frame.FramesDecoder.decode(FramesDecoder.java:155)
[error] at jdk.internal.net.http.Http2Connection$FramesController.processReceivedData(Http2Connection.java:240)
[error] at jdk.internal.net.http.Http2Connection.asyncReceive(Http2Connection.java:770)
[error] at jdk.internal.net.http.Http2Connection$Http2TubeSubscriber.processQueue(Http2Connection.java:1638)
[error] at jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
[error] at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
[error] at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
[error] at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:303)
[error] at jdk.internal.net.http.common.SequentialScheduler.runOrSchedule(SequentialScheduler.java:256)
[error] at jdk.internal.net.http.Http2Connection$Http2TubeSubscriber.runOrSchedule(Http2Connection.java:1655)
[error] at jdk.internal.net.http.Http2Connection$Http2TubeSubscriber.onNext(Http2Connection.java:1682)
[error] at jdk.internal.net.http.Http2Connection.sendConnectionPreface(Http2Connection.java:1378)
[error] at jdk.internal.net.http.Http2Connection.<init>(Http2Connection.java:415)
[error] at jdk.internal.net.http.Http2Connection.lambda$createAsync$0(Http2Connection.java:432)
[error] at jdk.internal.net.http.common.MinimalFuture.supply(MinimalFuture.java:65)
[error] at jdk.internal.net.http.Http2Connection.createAsync(Http2Connection.java:431)
[error] at jdk.internal.net.http.Exchange.lambda$checkForUpgradeAsync$14(Exchange.java:638)
[error] at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
[error] at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
[error] at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
[error] at jdk.internal.net.http.ResponseSubscribers.lambda$getBodyAsync$2(ResponseSubscribers.java:1174)
[error] at java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
[error] at java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
[error] at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
[error] at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
[error] at jdk.internal.net.http.ResponseSubscribers$NullSubscriber.onComplete(ResponseSubscribers.java:713)
[error] at jdk.internal.net.http.common.HttpBodySubscriberWrapper.complete(HttpBodySubscriberWrapper.java:293)
[error] at jdk.internal.net.http.common.HttpBodySubscriberWrapper.onComplete(HttpBodySubscriberWrapper.java:401)
[error] at jdk.internal.net.http.ResponseContent$FixedLengthBodyParser.onSubscribe(ResponseContent.java:568)
[error] at jdk.internal.net.http.Http1Response$BodyReader.onSubscribe(Http1Response.java:674)
[error] at jdk.internal.net.http.Http1AsyncReceiver.handlePendingDelegate(Http1AsyncReceiver.java:395)
[error] at jdk.internal.net.http.Http1AsyncReceiver.flush(Http1AsyncReceiver.java:214)
[error] at jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
[error] at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
[error] at jdk.internal.net.http.common.SequentialScheduler$TryEndDeferredCompleter.complete(SequentialScheduler.java:347)
[error] at jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:151)
[error] at jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
[error] ... 3 more |
|
|
||
| - name: Run tests with coverage | ||
| run: build/sbt -J-Xmx2G +jacoco | ||
| run: build/sbt -J-Xmx2G test |
There was a problem hiding this comment.
seeing your other thread, +jacoco is actually running tests .. right?
then we shouldnt change this. this PR should not modify anything unrelated to integratoin tests style
There was a problem hiding this comment.
Fine, let me revert it.
Signed-off-by: Zheng Hu <[email protected]>
tdas
left a comment
There was a problem hiding this comment.
LGTM. thank you for fixing this!
**PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** [<!-- Please state what you've changed and how it might affect the users. -->](unitycatalog#1142) --------- Signed-off-by: Zheng Hu <[email protected]>
**PR Checklist** - [x] A description of the changes is added to the description of this PR. - [x] If there is a related issue, make sure it is linked to this PR. - [x] If you've fixed a bug or added code that should be tested, add tests! - [x] If you've added or modified a feature, documentation in `docs` is updated **Description of changes** Backport the [PR change](#1149) of #1142 to branch-0.3. The whole backport process is here: #1163 Signed-off-by: Zheng Hu <[email protected]>
PR Checklist
docsis updatedDescription of changes