jdaugherty commented on code in PR #16553:
URL: https://github.com/apache/grails-core/pull/16553#discussion_r4218331160
##########
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:
Fixed in f7a977b66e. The current-build test no longer asserts
`isGrailsSnapshot()`. It only checks that the date is reported and kept out of
the versions map. Snapshot behavior is already covered by the fixture feature
`test version #version reports end of support`, which loads both `7.0.17` and
`7.0.18-SNAPSHOT`. Verified with `-PprojectVersion=7.0.18`.
##########
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:
Fixed in f7a977b66e. The test now asserts `versions["grails.version"] ==
VersionInfo.getGrailsVersion()`, the version written at build time from the
`grails-bom` POM. The end of support checks are unchanged. Passes with both
`7.0.18-SNAPSHOT` and `-PprojectVersion=7.0.18`.
--
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]