I am a potential new contributor who is checking out the code to make a Pull Request. The tests for JGit (and a handful of others) fail no matter what I do or how I checkout the code.
Originally I tried running the build with my local maven, "mvn clean install" which did not work. The wrapper, ".\mvnw clean install" also did not work on Windows. The concurrency tests threw lots of errors about folders being used by other processes.
So I pivoted to Docker and made a simple build file:
FROM openjdk:20-ea-17-oraclelinux8
COPY . /
ENTRYPOINT ["/bin/sh"]
Then I ran the commands, the third being from inside the docker container:
docker build .
docker run -it <image_id>
./mvnw clean install
The tests fail even on freshly checked out code with autocrlf=false (just in case). Here are the errors produced on the main branch build. Could someone please advise if I should skip these tests or am I doing something obviously wrong?
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] CompositeIntegrationTests$ListTests.contextLoads:161
Expected size: 3 but was: 0 in:
[]
[ERROR] CompositeIntegrationTests$ListTests.resourceEndpointsWork:176
expected:
"{"timestamp":"2023-03-15T14:05:18.268+00:00","status":500,"error":"Internal Server Error","path":"/foo/development/composite/bar.properties"}"
but was:
"foo: barconfig
"
[ERROR] CompositeIntegrationTests$ReverseLocationOrderTest.resourceEndpointsWork:127
expected: "{"timestamp":"2023-03-15T14:04:58.705+00:00","status":500,"error":"Internal Server Error","path":"/foo/development/composite/bar.properties"}"
but was: "foo: bar"
[ERROR] CompositeIntegrationTests$StaticTests.contextLoads:73
expected: 0
but was: 3
[ERROR] CompositeIntegrationTests$StaticTests.resourceEndpointsWork:89
expected:
"{"timestamp":"2023-03-15T14:06:12.341+00:00","status":500,"error":"Internal Server Error","path":"/foo/development/composite/bar.properties"}"
but was:
"foo: barconfig
"
[ERROR] VanillaConfigServerIntegrationTests.contextLoads:68
Expecting value to be false but was true
[ERROR] VanillaConfigServerIntegrationTests.invalidYaml:97
expected: 500
but was: 404
[ERROR] VanillaConfigServerIntegrationTests.resourseEndpointsWork:79 [invalid content]
expected: "foo: bar"
but was: "{"timestamp":"2023-03-15T14:05:18.866+00:00","status":500,"error":"Internal Server Error","path":"/foo/development/master/bar.properties"}"
[ERROR] CustomCompositeEnvironmentRepositoryTests$ListTests.contextLoads:129
expected: 0
but was: 3
[ERROR] CustomCompositeEnvironmentRepositoryTests$StaticTests.contextLoads:78
expected: 0
but was: 3
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testShouldFailIfRemoteBranchWasDeleted:624 Unexpected exception type thrown, expected: <org.springframework.cloud.config.server.environment.NoSuchLabelException> but was: <org.eclipse.jgit.api.errors.CheckoutConflictException>
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testUnknownLabelWithRemote:561 Unexpected exception type thrown, expected: <org.springframework.cloud.config.server.environment.NoSuchLabelException> but was: <org.eclipse.jgit.api.errors.CheckoutConflictException>
[ERROR] MultipleJGitEnvironmentRepositoryIntegrationTests.nonWritableBasedir:187
Expecting code to raise a throwable.
[ERROR] Errors:
[ERROR] AwsS3IntegrationTests » ExceptionInInitializer
[ERROR] ObservationIntegrationTests.testSuccessfulObservation:90 » IndexOutOfBounds In...
[ERROR] AwsParameterStoreEnvironmentRepositoryTests » ExceptionInInitializer
[ERROR] AwsS3EnvironmentRepositoryTests » ExceptionInInitializer
[ERROR] AwsSecretsManagerEnvironmentRepositoryTests » ExceptionInInitializer
[ERROR] JGitEnvironmentRepositoryConcurrencyTests.concurrentRefreshContextAndGetLabels:134 » IO
[ERROR] JGitEnvironmentRepositoryConcurrencyTests.vanilla:116 » Execution org.springfr...
[ERROR] JGitEnvironmentRepositoryIntegrationTests.findOne_CloneOnStartTrue_FindOneSuccess:305 » NoSuchRepository
[ERROR] JGitEnvironmentRepositoryIntegrationTests.findOne_FileAddedToRepo_FindOneSuccess:319 » NoSuchRepository
[ERROR] JGitEnvironmentRepositoryIntegrationTests.pull:135 » NoSuchRepository Cannot c...
[ERROR] JGitEnvironmentRepositoryIntegrationTests.pullMissingRepo:208->pull:135 » NoSuchRepository
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testNewCommitID:465 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testNewCommitIDWithRefreshRate:508 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testNewRemoteBranch:400 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testNewRemoteTag:425 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testShouldReturnEnvironmentFromLocalBranchInCaseRemoteDeleted:609 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.testVersionUpdate:359 » CheckoutConflict
[ERROR] JGitEnvironmentRepositoryIntegrationTests.vanilla:108 » NoSuchRepository Canno...
[ERROR] JGitEnvironmentRepositoryTests.basedir:204 » NoSuchRepository Cannot clone or ...
[ERROR] JGitEnvironmentRepositoryTests.basedirExists:216 » NoSuchRepository Cannot clo...
[ERROR] JGitEnvironmentRepositoryTests.tag:194 » NoSuchRepository Cannot clone or chec...
[ERROR] JGitEnvironmentRepositoryTests.testBranchEndsWithTag:241 » NoSuchRepository Ca...
[ERROR] JGitEnvironmentRepositoryTests.vanilla:131 » NoSuchRepository Cannot clone or ...
[ERROR] MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.defaultRepo:84 » NoSuchRepository
[ERROR] MultipleJGitEnvironmentApplicationPlaceholderRepositoryTests.missingRepo:93 » NoSuchRepository
[ERROR] MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.defaultRepo:88 » NoSuchRepository
[ERROR] MultipleJGitEnvironmentProfilePlaceholderRepositoryTests.locationsMissingProfile:126 » NoSuchRepository
[ERROR] MultipleJGitEnvironmentRepositoryIntegrationTests.defaultRepo:85 » NoSuchRepository
[ERROR] MultipleJGitEnvironmentRepositoryTests.defaultRepo:93 » NoSuchRepository Canno...
[ERROR] MultipleJGitEnvironmentRepositoryTests.defaultRepoTag:138 » NoSuchRepository C...
[ERROR] MultipleJGitEnvironmentRepositoryTests.defaultRepoTwice:147 » NoSuchRepository
[ERROR] RedisEnvironmentRepositoryIntegrationTests » IllegalState Previous attempts to...
[INFO]
[ERROR] Tests run: 648, Failures: 13, Errors: 32, Skipped: 8
Comment From: ryanjbaxter
Its hard for me to help here as no one on the team has a windows machine to test this.
One thing to note is that the main branch requires Java 17 so your docker image using Java 8 would not work.
Comment From: andygnelson
@ryanjbaxter in that docker image, 20 is the Java version, 8 is the Linux version. Trying again with "openjdk:17-ea-17-oraclelinux8" just to be sure it's not a 20 vs 17 thing.
Comment From: andygnelson
Same errors, included Java version command:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:26 min
[INFO] Finished at: 2023-03-15T15:16:41Z
[INFO] Final Memory: 169M/587M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project spring-cloud-config-server: There are test failures.
[ERROR]
[ERROR] Please refer to /spring-cloud-config-server/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :spring-cloud-config-server
sh-4.4# java -version
openjdk version "17-ea" 2021-09-14
OpenJDK Runtime Environment (build 17-ea+17-1401)
OpenJDK 64-Bit Server VM (build 17-ea+17-1401, mixed mode, sharing)
sh-4.4#
Comment From: ryanjbaxter
I am not sure to be honest, these builds are working on multiple CI systems
Comment From: andygnelson
Ok, trying one last ditch effort which is to clone the project from inside the docker container. Obviously that isn't going to be a great development experience but it may help me narrow down some issues if it has to do with the way git is cloning things on Windows.
Comment From: andygnelson
So after cloning directly into docker most of the issues go away except for one test case for an unwritable directory, which I'm sure is failing because I'm running as root at the moment so everything is writeable.
That being said, I guess I could just skip the tests that fail when checked out on Windows and hope for the best when I make my PR. Will my PR be run on the CI machine once I push it for review?
Comment From: ryanjbaxter
Yes each PR will trigger a GitHub action that runs the build on the branch