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

Green build #64

Merged
merged 10 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
with:
java-version: '8'
distribution: 'adopt'
- name: Test meta-schema uri
run: curl -v https://json-schema.org/draft/2019-09/schema
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Temp step to just check the box can reach the URL

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Build with Gradle
Expand Down
9 changes: 9 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ test {
useJUnitPlatform()

systemProperty "run.smoke.test", project.findProperty('run.smoke.test') ?: false

testLogging {
showStandardStreams = false
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showCauses = true
showExceptions = true
showStackTraces = true
}
Comment on lines +54 to +60
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need more logging on the build server to see what's failing.

}

dependencies {
Expand All @@ -63,5 +71,6 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1'
testImplementation 'org.json:json:20231013'
testImplementation 'org.hamcrest:hamcrest-core:2.2'
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import static net.jimblackler.jsonschemafriend.ResourceUtils.getResource;
import static net.jimblackler.jsonschemafriend.ResourceUtils.getResourceAsStream;
import static net.jimblackler.jsonschemafriend.TestUtil.clearDirectory;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.Assumptions.assumeTrue;

Expand Down Expand Up @@ -180,8 +182,8 @@ private Collection<DynamicNode> test(String dirName, boolean mustFail) {

System.out.println(objectWriter.writeValueAsString(output));

assertTrue(extraReported.isEmpty(), "Errors reported not seen in reference file");
assertTrue(notReported.isEmpty(), "Errors in reference file not reported");
assertThat("Errors reported not seen in reference file", extraReported, is(empty()));
assertThat("Errors in reference file not reported", notReported, is(empty()));
Comment on lines +185 to +186
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switching to hamcrest prints out the content of these when not empty. Which is useful for tracking down errors that only happen on the build server.

}

maybeWriteOutPassFile(mustFail, schemaName, testFileName);
Expand Down
Loading