-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use published conformance tests #126
Conversation
…er-framework into publish-conformance-tests
…er-framework into publish-conformance-tests
…oject to the local Maven repo if that build is included.
…er-framework into publish-conformance-tests
I need to update development docs too. Basically, if you don't need to make coordinated changes to the reference checker and jspecify or the conformance tests at the same time, you don't have to clone jspecify at all. Otherwise, clone jspecify and build with |
Right now the CI downloads JSpecify 0.3.0 and the latest snapshot of the tests from Maven. I should change the CI to keep the current behavior of using JSpecify HEAD. |
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 assume CI fails because jspecify/jspecify#446 wasn't executed yet?
settings.gradle
Outdated
@@ -33,8 +25,9 @@ dependencyResolutionManagement { | |||
library("errorProne-core", "com.google.errorprone:error_prone_core:2.18.0") | |||
library("errorProne-javac", "com.google.errorprone:javac:9+181-r4173-1") | |||
library("guava", "com.google.guava:guava:31.1-jre") | |||
library("jspecify", "org.jspecify:jspecify:0.0.0-SNAPSHOT") | |||
library("jspecify", "org.jspecify:jspecify:0.3.0") |
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'm a bit confused by the different versions used... demo
uses jspecify-0.0.0-SNAPSHOT.jar
and the conformance artifacts below use 0.0.0-SNAPSHOT
. Why is this now 0.3.0?
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'm going to document this somewhere in the repo as well, but here's what I'm thinking:
The reference checker has the following dependencies:
- on
jspecify
for its implementation: some of its own APIs are annotated - on the conformance test suite ZIP file
- on the conformance test framework library
Those would also be dependencies of any JSpecify-compliant tool, although the first one is optional: they don't have to annotate their own code.
For each of those dependencies, I want developers to be able to depend on either a published version (snapshot or not) or a local build.
I expect the version numbers of those three things, once they're published, to vary independently. We'd update the test suite version every time we change or add a test case; the test framework library only when that changes; and jspecify itself very rarely.
I want to publish snapshot versions of the test suite and the test framework so that by default the reference checker depends on those for its tests. That puts the reference checker on the same footing as any other tool, which I would expect to use (probably non-snapshot) published versions of both.
So the idea will be, eventually, that by default the reference checker uses published snapshots of both, but there's a simple way to use a local clone (at whatever commit) for either one. Then our CI would use a local clone of the main
branch for both in order to retain the current behavior.
That's what I'm trying to do now (but I'm not done) for the conformance test suite and jspecify
: If you want the local build, you --include-build path/to/jspecify
and those get substituted no matter what version is specified here. Otherwise, we'll use jspecify:0.3.0
(because why shouldn't we?) and conformance-tests-0.0.0-SNAPSHOT
(which is published already, although only manually for now).
…er-framework into publish-conformance-tests
OK, I think this is ready to be re-reviewed. |
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.
Thanks for all the documentation additions! The changes look good to me.
I tried the PR locally, in an empty directory doing:
git clone [email protected]:jspecify/jspecify-reference-checker.git
cd jspecify-reference-checker/
gh pr checkout 126
./gradlew build
I would have expected this to pass, like it does on CI.
However, this results in:
tests.ConformanceTest > conformanceTests FAILED
diff (-expected +actual):
@@ -1,4 +1,4 @@
-# 12 pass; 7 fail; 19 total; 63.2% score
+# 10 pass; 9 fail; 19 total; 52.6% score
PASS: Basic.java:28 test:expression-type:Object?:nullable
PASS: Basic.java:28 test:sink-type:Object!:return
PASS: Basic.java:28 test:cannot-convert:Object? to Object!
@@ -16,6 +16,6 @@
FAIL: Irrelevant.java:47 test:irrelevant-annotation:NullMarked
FAIL: Irrelevant.java:49 test:irrelevant-annotation:NullUnmarked
FAIL: Irrelevant.java: no unexpected facts
-PASS: UsesDep.java:24 test:cannot-convert:null? to Dep*
-PASS: UsesDep.java: no unexpected facts
+FAIL: UsesDep.java:24 test:cannot-convert:null? to Dep*
+FAIL: UsesDep.java: no unexpected facts
What does the PASS vs FAIL output mean? Does it not get the expected output?
Can you reproduce this?
The difference to the CI build is that I'm not using the |
…er-framework into publish-conformance-tests
Look for an existing jspecify jar file and build the project if needed
…ce-checker into publish-conformance-tests
@wmdietl, which version of Java are you using? When I run with Java 11, I see the same failure you do. When I run with Java 17 (like the CI, although not the identical distro), it passes. I have no idea why. |
Aha! I found it.
With which Java version should we publish the conformance tests? |
I'm going with Java 8, just like the annotations. See jspecify/jspecify#451. |
…er-framework into publish-conformance-tests
@wmdietl I think the problem is now fixed. I pasted those commands in while in an empty directory, and it passed. (You might have to refresh your Gradle dependencies so that it picks up the newest snapshot version.) Let me know if it works for you. |
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've been using Java 11, which explains that failure. Thanks for making it work for Java 8+.
I've just run the conformance tests again and things are working correctly now.
Use the published JSpecify artifacts instead of requiring a local clone of https://github.com/jspecify/jspecify. Allow the user to include a local clone with
--included-build path/to/jspecify
, and use those artifacts instead in that case.Requires jspecify/jspecify#446.
Part of #107.