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

Initial toolchain upgrade #185

Merged
merged 8 commits into from
Oct 23, 2024

Conversation

Poundex
Copy link
Contributor

@Poundex Poundex commented Oct 6, 2024

Here's a start on getting the build and dependencies updated. I've updated Gradle to 8, and it will now build with Java 11.

The full build of the Geb components, all the test suites, and the docsites & manuals are all building & passing for me locally. Most of it is also working in Geb's CI container image, except for a few of the documentation-based tasks. I don't know if they would have actually failed in CI or it is an artefact of my local build environment. That/those images will need updating with a newer JDK, anyway.

Did a very brief smoke test with the build libraries, and it seems to be working. However, I did have to use a very specific version of the Selenium driver & support library (and it's not the version that's documented in the Quickstart). (Turns out I had a mix of Selenium library versions on the go. 4.25.0 is fine)

@Poundex Poundex requested a review from jonnybot0 October 6, 2024 16:42
@jonnybot0
Copy link
Contributor

Thanks! This looks on the right track.

We will need to appropriately update the CircleCI configuration for this to work. These errors:
https://app.circleci.com/pipelines/github/geb/geb/443/workflows/aba0a161-2cdd-4292-b267-5a1a754c4406/jobs/6303

Seem to indicate that Gradle isn't detecting the version of Java we need as installed in the docker image it's running on.

.circleci/config.yml seems to indicate that we're using a custom image. That image is built from https://github.com/geb/ci-docker-image. I'd bet if we added openjdk-11-jdk to the list of software installed in https://github.com/geb/ci-docker-image/blob/master/Dockerfile#L3, then updated the image used in the .circleci/config.yml file, this would pass.

Let's hold off on merging this until we've got the build steps passing. I'll be happy to merge as many PRs as we need on the CI image.

While you're in there, it would be worth it to try and update the Ubuntu image it's based on, since I've already done that for the build tasks that build directly on Ubuntu.

@Poundex Poundex force-pushed the topic/initial-toolchain-upgrade branch from 9e4cb78 to 795ffb6 Compare October 9, 2024 13:00
@Poundex Poundex marked this pull request as draft October 10, 2024 16:01
@Poundex
Copy link
Contributor Author

Poundex commented Oct 10, 2024

Web Driver binaries plugin removed as the Web Drivers are now baked directly into the image (this was necessary for the ChromeDriver anyway due to version incompatibilities with the browser).

Updated the CI image and the CI config and now builds are passing.

Moved to draft pending getting a new version of the CI image built and pushed.

@Poundex Poundex requested a review from sdelamo October 10, 2024 18:22
@Poundex Poundex force-pushed the topic/initial-toolchain-upgrade branch 3 times, most recently from 9c59964 to 59b1b58 Compare October 21, 2024 19:53
@Poundex Poundex marked this pull request as ready for review October 22, 2024 08:34
@Poundex Poundex requested a review from jonnybot0 October 22, 2024 08:34
- run:
docker network create dind
docker run -d --network dind -e DOCKER_TLS_CERTDIR="" --privileged --name dind docker:dind
sleep 20
Copy link
Contributor

@jonnybot0 jonnybot0 Oct 22, 2024

Choose a reason for hiding this comment

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

20 seconds seems like a long time. Does it need to be that long? What is the sleep for, exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The delay is waiting for the dind container to start, which includes the container itself waiting for about 15 seconds, so 20 seconds is just to make sure it has had time to fully start up

sauceConnect = "1.153"
selenium = "4.2.2"
spock = "2.3-groovy-4.0"
spock = "2.4-M4-groovy-4.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer we stick to stable releases when merging to master. Milestones are fine for testing. Is there a reason you need 2.4-M4 over 2.3?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the one bit of feedback I'd prefer to see addressed. Let's use 2.3, and we should be good to go.

website = "https://gebish.org/manual/current/#gradle-plugins"
vcsUrl = "https://github.com/geb/geb"
tags = ["geb", "testing", "cloud", "browser"]
Copy link
Contributor

Choose a reason for hiding this comment

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

We should carry over these tags. Just use
tags.set(['search', 'tags', 'for', 'your', 'hello', 'plugin'])
rather than tags = ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, nevermind, I see you've moved them to plugin-definitions.gradle. That's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah this is just a change to the Gradle plugin plugin that has had to be followed

super(remoteAddress, new ChromeOptions().addArguments('headless'))
super(remoteAddress, new ChromeOptions()
.addArguments('headless')
.addArguments('--remote-allow-origins=*')
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it's redundant, but could we add the same TODO here as above?

@@ -18,11 +18,13 @@ package geb.module
import geb.test.GebSpecWithCallbackServer
import geb.test.browsers.Chrome
import geb.test.browsers.RequiresRealBrowser
import spock.lang.Ignore

import java.time.LocalDateTime

@Chrome
@RequiresRealBrowser // maybe due to https://sourceforge.net/p/htmlunit/bugs/1923/
Copy link
Contributor

Choose a reason for hiding this comment

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

Ignoring these tests has me a wee bit nervous that we've broken something. For a major release with a proper deprecation announcement, I'm okay with that, but that's not what we're aiming for here. I'm going to play around with these locally and have a think,.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've captured the tests I disabled on #188. I've looked into two out of three of them. One of them is a change in Chrome itself. I've already fixed that one here https://github.com/Poundex/geb/tree/topic/fix-datetime-local-chrome it's just based off the upgraded branch so was waiting for that to be in before opening the MR.

The reporting one I've investigated, and it also seems genuinely broken, but it's to do with threads so sometimes needs to be ran a few times before it can be seen failing (Spock's @RepeatUntilFailure is handy for this). I don't know if this was passing by chance before, or something has changed in the way either Gradle or Spock runs stuff in parallel. I haven't looked into fixing this one yet as it seems like quite a complicated task, but it does appear that Geb's reporting is not thread-safe.

I haven't had a chance to look into the third one yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't reproduce the issue with PageOrientedSpec so I've enabled it and it seems to be passing in CI

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Glad to hear the PageOrientedSpec test is back online.

The other two problems (the date spec and the parallel execution spec) have me more nervous. Suppose someone is passing an ISO8601 formatted date time to Geb. Before this update, that works. After this update, it doesn't. Same problem if they're relying on parallel execution.

In this case, working around it by using JavaScript seems like hiding a breaking change. Here, the test is a set of executable documentation telling us what the value API is expected to do.

I haven't had a chance to really dig into this yet, but I really think we shouldn't rely on workarounds if we can avoid it at all. I think we're on the right path, but ideally the test API would continue to behave the same as before. Tooling updates shouldn't break that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done a bit more digging into the issues around the DateTimeLocalInputSpec and left a comment on #188. In short, the root cause is the Java update changes the default precision of LocalDateTime.now(), and as the String value of this is the only thing used as the test value then this test was always passing by accident. Whether it be caused by a Java update past 9 which changes the default precision, or be it by a datetime String coming from some other source that has a precision greater than millisecond then there is no combination of Chrome and Geb version where that test would have passed. There should definitely be some discussion on how to approach the problem, but I think that should be a focused conversation in its own thread, and not here.

It is a similar story with the ParallelExecutionSpec, nothing is behaving any differently then it was before these changes and the issue is reproducible in current master. If you don't want to make any releases before these issues are addressed then that's fine, but I think they are outside the scope of this MR.

Copy link
Contributor

Choose a reason for hiding this comment

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

That all makes sense. Let's merge for now and carry on discussion over on the issue.

@Poundex Poundex marked this pull request as draft October 22, 2024 18:05
@Poundex Poundex force-pushed the topic/initial-toolchain-upgrade branch 2 times, most recently from 3502e8f to cd4e319 Compare October 22, 2024 18:34
@Poundex Poundex marked this pull request as ready for review October 22, 2024 19:37
@Poundex Poundex marked this pull request as draft October 23, 2024 18:04
@Poundex Poundex force-pushed the topic/initial-toolchain-upgrade branch from 5247b6e to 267eea2 Compare October 23, 2024 18:20
@jonnybot0 jonnybot0 removed the request for review from sdelamo October 23, 2024 18:31
@Poundex Poundex marked this pull request as ready for review October 23, 2024 18:36
@Poundex Poundex merged commit d4b4c56 into apache:master Oct 23, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants