jamesfredley commented on code in PR #16553:
URL: https://github.com/apache/grails-core/pull/16553#discussion_r4220950126
##########
grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/util/VersionInfoSpec.groovy:
##########
@@ -31,4 +40,50 @@ class VersionInfoSpec extends Specification {
version.key == 'grails.version'
version.value
}
+
+ @Unroll
+ void "test version #version reports end of support"() {
+ given:
+ Class<?> versionInfo = loadVersionInfo(version, '2026-10-31')
+
+ expect:
+ versionInfo.getMethod('getEndOfSupport').invoke(null) ==
Optional.of(LocalDate.of(2026, 10, 31))
+
!versionInfo.getMethod('getDependencyVersions').invoke(null).containsKey('grails.endOfSupport')
+
versionInfo.getMethod('getDependencyVersions').invoke(null)['grails.version']
== version
+
+ where:
+ version << ['7.0.17', '7.0.18-SNAPSHOT']
+ }
+
+ @Unroll
+ void "test no end of support is reported for version #version and date
#endOfSupport"() {
+ given:
+ Class<?> versionInfo = loadVersionInfo(version, endOfSupport)
+
+ expect:
+ versionInfo.getMethod('getEndOfSupport').invoke(null) ==
Optional.empty()
+
!versionInfo.getMethod('getDependencyVersions').invoke(null).containsKey('grails.endOfSupport')
+
+ where:
+ version | endOfSupport
+ '7.0.17' | null
+ '7.0.17' | '20207-07-31'
+ }
+
+ void "test the current snapshot build reports end of support"() {
+ expect:
+ VersionInfo.isGrailsSnapshot()
Review Comment:
The snapshot check no longer depends on the version of the build that is
running the test.
##########
grails-forge/grails-forge-api/src/test/groovy/org/grails/forge/api/ApplicationControllerSpec.groovy:
##########
@@ -55,6 +58,16 @@ class ApplicationControllerSpec extends Specification {
response.versions["grails.version"]
}
+ void "test snapshot versions report end of support"() {
+ given:
+ def response =
client.toBlocking().retrieve(HttpRequest.GET('/versions'), Map)
+
+ expect:
+ response.versions["grails.version"].endsWith('-SNAPSHOT')
Review Comment:
The /versions assertion no longer requires a -SNAPSHOT version, so a release
build can still report the configured version and its end-of-support date.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]