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

PR builds failing on Ubuntu 11, latest #1191

Closed
paul-dingemans opened this issue Jul 31, 2021 · 5 comments
Closed

PR builds failing on Ubuntu 11, latest #1191

paul-dingemans opened this issue Jul 31, 2021 · 5 comments

Comments

@paul-dingemans
Copy link
Collaborator

I have a PR #1052 which is failing on the Ubuntu 11 latest build. I expect that same is happening on #1117 and #1190. Is there something that we as contributors can (or should do) in order to pass the build?

@shashachu
Copy link
Contributor

Thanks @paul-dingemans. Looks like a test failing on Ubuntu 11 for the new SarifReporter:

com.pinterest.ktlint.reporter.sarif.SarifReporterTest > testReportGeneration FAILED
    org.junit.ComparisonFailure at SarifReporterTest.kt:50

I'm ok with @Ignoreing that test and filing an issue to fix it to unblock your and others' PRs. If you would like to open the PR go ahead, or I can take a look tomorrow. Thanks!

@shashachu
Copy link
Contributor

shashachu commented Aug 4, 2021

@chao2zhang do you think you could take a look? I have PR #1194 open to upload test artifacts, and running it on my fork I get the following:

org.junit.ComparisonFailure: actual = {"$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","version":"2.1.0","runs":[{"originalUriBaseIds":{"%SRCROOT%":{"uri":"file:///home/runner/"}},"results":[{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"one-fixed-and-one-not.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":1}}}],"message":{"text":"<\"&'>"},"ruleId":"rule-1"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"one-fixed-and-one-not.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":2}}}],"message":{"text":"Andifyouseemyfriend"},"ruleId":"rule-2"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"two-not-fixed.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":10,"startLine":1}}}],"message":{"text":"IthoughtIwouldagain"},"ruleId":"rule-1"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"two-not-fixed.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":20,"startLine":2}}}],"message":{"text":"Asinglethinstraightline"},"ruleId":"rule-2"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"all-corrected.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":1}}}],"message":{"text":"Ithoughtwehadmoretime"},"ruleId":"rule-1"}],"tool":{"driver":{"downloadUri":"https://github.com/pinterest/ktlint/releases/tag/0.7.0","fullName":"ktlint","informationUri":"https://github.com/pinterest/ktlint/","language":"en","name":"ktlint","organization":"pinterest","rules":[],"semanticVersion":"0.7.0","version":"0.7.0"}}}]}, expected = {"$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","version":"2.1.0","runs":[{"originalUriBaseIds":{"%SRCROOT%":{"uri":"file:///home/runner/"}},"results":[{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"one-fixed-and-one-not.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":1}}}],"message":{"text":"<\"&'>"},"ruleId":"rule-1"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"one-fixed-and-one-not.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":2}}}],"message":{"text":"Andifyouseemyfriend"},"ruleId":"rule-2"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"two-not-fixed.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":10,"startLine":1}}}],"message":{"text":"IthoughtIwouldagain"},"ruleId":"rule-1"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"two-not-fixed.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":20,"startLine":2}}}],"message":{"text":"Asinglethinstraightline"},"ruleId":"rule-2"},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"uri":"all-corrected.kt","uriBaseId":"%SRCROOT%"},"region":{"startColumn":1,"startLine":1}}}],"message":{"text":"Ithoughtwehadmoretime"},"ruleId":"rule-1"}],"tool":{"driver":{"downloadUri":"https://github.com/pinterest/ktlint/releases/tag/null","fullName":"ktlint","informationUri":"https://github.com/pinterest/ktlint/","language":"en","name":"ktlint","organization":"pinterest","rules":[]}}}]} expected:<...ktlint/releases/tag/[null","fullName":"ktlint","informationUri":"https://github.com/pinterest/ktlint/","language":"en","name":"ktlint","organization":"pinterest","rules":[]]}}}]}> but was:<...ktlint/releases/tag/[0.7.0","fullName":"ktlint","informationUri":"https://github.com/pinterest/ktlint/","language":"en","name":"ktlint","organization":"pinterest","rules":[],"semanticVersion":"0.7.0","version":"0.7.0"]}}}]}>

It looks like some sort of mismatch in version. I don't know enough about the Sarif format to totally understand the error.

@chao2zhang
Copy link
Contributor

The problem is that getKtlintVersion() returns null at https://github.com/pinterest/ktlint/blob/master/ktlint-reporter-sarif/src/main/kotlin/com/pinterest/ktlint/reporter/sarif/SarifReporter.kt#L67.

I don't have easy access to ubuntu locally. Is it possible to bisect the commits to investigate when they started to break? The build until 7/29 seems to pass consistently.

@shashachu
Copy link
Contributor

@chao2zhang I think it may be the opposite - the expected has null for the version, but on ubuntu 11, it seems to return non-null (0.70?) for some reason. i've been doing test runs on my fork and getting weird inconsistent results. I'll dig in further.

@paul-dingemans
Copy link
Collaborator Author

My PR's are no longer blocked. So closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants