jdaugherty commented on code in PR #16169: URL: https://github.com/apache/grails-core/pull/16169#discussion_r4264874459
########## grails-test-examples/benchmarks/src/report/groovy/org/apache/grails/benchmarks/report/AppIndyBench.groovy: ########## @@ -0,0 +1,244 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.grails.benchmarks.report + +import groovy.transform.CompileStatic + +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.StandardOpenOption + +@CompileStatic +class AppIndyBench { + + static final List<App> APPS = [ + new App('latency', ':grails-test-examples-latency:integrationTest', 'latencyapp.AppBenchFastPingSpec'), + new App('app1', ':grails-test-examples-app1:integrationTest', 'functionaltests.AppBenchInterceptorDemoSpec'), + new App('gsp-layout', ':grails-test-examples-gsp-layout:integrationTest', 'org.example.grails.layout.AppBenchDemoRenderTextSpec') + ].asImmutable() + + static void main(String[] args) { + int exit = run(args, new WrapperGradleRunner()) + if (exit != 0) { + System.exit(exit) + } + } + + static int run(String[] args, GradleRunner runner) { + return run(args, runner, new GitHubComments(), System.getenv()) + } + + static int run(String[] args, GradleRunner runner, CommentPoster poster, Map<String, String> environment) { + try { + Options options = parse(args) + Path noindyDir = recreateDirectory(options.outputDir.resolve('noindy')) + Path indyDir = recreateDirectory(options.outputDir.resolve('indy')) + + ['false', 'true'].each { String indy -> + Path modeDir = indy == 'true' ? indyDir : noindyDir + APPS.each { App app -> + Path out = modeDir.resolve(app.name + '.json') + runner.run(options.projectDir, gradleArgs(options, app, indy, out)) + if (!Files.isRegularFile(out)) { Review Comment: Closing this one as won't-do rather than a follow-up. Two builds would run every app in one mode and then every app in the other, which gives up the per-app mode alternation that spreads runner drift across both modes, and on GitHub runners that ordering is the one most exposed to drift. The three integration tests would also have to be serialized to keep their latency samples apart, so the saving is configuration time only. A mode switch is also cheaper than I assumed: `-PgrailsIndy` only reaches the Grails plugin modules and the app through `grails-extension-gradle-config.gradle`, the core modules never opt out, so it is not a framework rebuild. The job has never run yet either (every run so far skipped it for lack of the `performance` label), so the 180-minute limit is a ceiling, not a measurement. If it turns out slow once it runs, the lever is the nested builds' configuration time, not merging them. ########## grails-test-examples/benchmarks/src/report/groovy/org/apache/grails/benchmarks/report/AppIndyBench.groovy: ########## @@ -0,0 +1,244 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.grails.benchmarks.report + +import groovy.transform.CompileStatic + +import java.nio.charset.StandardCharsets +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.StandardOpenOption + +@CompileStatic +class AppIndyBench { + + static final List<App> APPS = [ + new App('latency', ':grails-test-examples-latency:integrationTest', 'latencyapp.AppBenchFastPingSpec'), Review Comment: Folded the wiring in 59ec5e6f34: the `-PappBench=true` integrationTest setup now lives in `gradle/functional-test-config.gradle`, guarded on the plugin that registers `integrationTest`, and `gradle/app-bench-config.gradle` is gone, so a benched app no longer has to apply anything extra. The roster stays explicit, as you preferred, so a missing named spec still fails fast. -- 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]
