Skip to content

GROOVY-12843: check contracts on interface methods with a body - #3371

Open
paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:contracts-default-methods
Open

paulk-asert wants to merge 1 commit into
apache:masterfrom
paulk-asert:contracts-default-methods

Conversation

@paulk-asert

Copy link
Copy Markdown
Contributor

A @requires or @ensures on a default or static interface method was woven into the method, but the check reads a $GCONTRACTS_ENABLED field that was added only to classes: every call failed with a missing property, and static compilation was refused. An interface with a concrete method now has the field, and the check reads it from the interface.

A postcondition also called the old-variables method, which only a class compiled with contracts has, and which holds that class's fields. In an interface method with a body, old.name is now the entry value of a parameter or of a property of the interface, read through its getter, so lambdas, coerced maps and Java classes work however they store it. Any other name is a compile error. A name used only by a postcondition inherited from a separately compiled interface cannot be seen by the compiler; reading it throws an exception that says so.

A @requires or @ensures on a default or static interface method was woven
into the method, but the check reads a $GCONTRACTS_ENABLED field that was
added only to classes: every call failed with a missing property, and
static compilation was refused. An interface with a concrete method now
has the field, and the check reads it from the interface.

A postcondition also called the old-variables method, which only a class
compiled with contracts has, and which holds that class's fields. In an
interface method with a body, old.name is now the entry value of a
parameter or of a property of the interface, read through its getter, so
lambdas, coerced maps and Java classes work however they store it. Any
other name is a compile error. A name used only by a postcondition
inherited from a separately compiled interface cannot be seen by the
compiler; reading it throws an exception that says so.
@testlens-app

testlens-app Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

🚨 TestLens detected 2 failed tests 🚨

Test Summary

Tip

Inspect all details with the TestLens CLI: testlens pr 3371

Build and test / lts (25, ubuntu-latest) > :test

Test Runs Flakiness
GrabResolverTest > testResolverDefinitionResolvesDependency() ❌ 0% 🟢
GrabResolverTest > testResolverDefinitionResolvesDependencyWithShorthand() ❌ 0% 🟢

🏷️ Commit: 6ee1060
▶️ Tests: 145609 executed
⚪️ Checks: 26/26 completed

Test Failures

GrabResolverTest > testResolverDefinitionResolvesDependency() (:test in Build and test / lts (25, ubuntu-latest))
java.lang.AssertionError: Forked JVM for groovy.grape.GrabResolverTest#testResolverDefinitionResolvesDependency failed:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.restlet#org.restlet;1.1.6: not found]

java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.restlet#org.restlet;1.1.6: not found]
	at groovy.grape.ivy.GrapeIvy.getDependencies(GrapeIvy.groovy:609)
	at groovy.grape.ivy.GrapeIvy.resolve(GrapeIvy.groovy:908)
	at groovy.grape.ivy.GrapeIvy.resolve(GrapeIvy.groovy:875)
	at groovy.grape.ivy.GrapeIvy.grab(GrapeIvy.groovy:510)
	at groovy.grape.Grape.grab(Grape.java:320)
	at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:452)
	at org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:427)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:1204)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:924)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:857)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:470)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:405)
	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:690)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:702)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:575)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
	at groovy.grape.GrabResolverTest.testResolverDefinitionResolvesDependency(GrabResolverTest.groovy:77)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:700)
	at org.junit.platform.commons.support.ReflectionSupport.invokeMethod(ReflectionSupport.java:528)
	at org.junit.jupiter.engine.support.MethodReflectionUtils.invoke(MethodReflectionUtils.java:53)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:61)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:124)
	at groovy.junit6.plugin.ForkedJvmExtension.interceptTestMethod(ForkedJvmExtension.java:82)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:124)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:99)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:163)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:148)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:124)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:99)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:66)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:47)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:39)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:98)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invokeVoid(InterceptingExecutableInvoker.java:71)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$0(TestMethodTestDescriptor.java:219)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:215)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:157)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:70)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:176)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:42)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:180)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:42)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:180)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:36)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:52)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:58)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.executeEngine(EngineExecutionOrchestrator.java:256)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.failOrExecuteEngine(EngineExecutionOrchestrator.java:228)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:189)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:109)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:66)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:168)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:65)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:126)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:100)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:57)
	at org.junit.platform.launcher.core.InterceptingLauncher.lambda$execute$0(InterceptingLauncher.java:46)
	at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25)
	at org.junit.platform.launcher.core.InterceptingLauncher.execute(InterceptingLauncher.java:45)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:57)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:76)
	at groovy.junit6.plugin.ForkedJvmTestRunner.main(ForkedJvmTestRunner.java:111)

1 error

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:351)
	at org.codehaus.groovy.control.ErrorCollector.addException(ErrorCollector.java:198)
	at org.codehaus.groovy.control.SourceUnit.addException(SourceUnit.java:281)
	at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:461)
	at org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:427)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:1204)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:924)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:857)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:470)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:405)
	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:690)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:702)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:575)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
	at groovy.grape.GrabResolverTest.testResolverDefinitionResolvesDependency(GrabResolverTest.groovy:77)

	at groovy.junit6.plugin.ForkedJvmExtension.propagateOutcome(ForkedJvmExtension.java:256)
	at groovy.junit6.plugin.ForkedJvmExtension.runInForkedJvm(ForkedJvmExtension.java:118)
	at groovy.junit6.plugin.ForkedJvmExtension.interceptTestMethod(ForkedJvmExtension.java:100)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
GrabResolverTest > testResolverDefinitionResolvesDependencyWithShorthand() (:test in Build and test / lts (25, ubuntu-latest))
java.lang.AssertionError: Forked JVM for groovy.grape.GrabResolverTest#testResolverDefinitionResolvesDependencyWithShorthand failed:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Error grabbing Grapes -- [unresolved dependency: org.restlet#org.restlet;1.1.6: not found]

java.lang.RuntimeException: Error grabbing Grapes -- [unresolved dependency: org.restlet#org.restlet;1.1.6: not found]
	at groovy.grape.ivy.GrapeIvy.getDependencies(GrapeIvy.groovy:609)
	at groovy.grape.ivy.GrapeIvy.resolve(GrapeIvy.groovy:908)
	at groovy.grape.ivy.GrapeIvy.resolve(GrapeIvy.groovy:875)
	at groovy.grape.ivy.GrapeIvy.grab(GrapeIvy.groovy:510)
	at groovy.grape.Grape.grab(Grape.java:320)
	at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:452)
	at org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:427)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:1204)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:924)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:857)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:470)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:405)
	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:690)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:702)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:575)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
	at groovy.grape.GrabResolverTest.testResolverDefinitionResolvesDependencyWithShorthand(GrabResolverTest.groovy:88)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:700)
	at org.junit.platform.commons.support.ReflectionSupport.invokeMethod(ReflectionSupport.java:528)
	at org.junit.jupiter.engine.support.MethodReflectionUtils.invoke(MethodReflectionUtils.java:53)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:61)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:124)
	at groovy.junit6.plugin.ForkedJvmExtension.interceptTestMethod(ForkedJvmExtension.java:82)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:124)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:99)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:163)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:148)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:124)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:99)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:66)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:47)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:39)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:98)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invokeVoid(InterceptingExecutableInvoker.java:71)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$0(TestMethodTestDescriptor.java:219)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:215)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:157)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:70)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:176)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:42)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:180)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:42)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$2(NodeTestTask.java:180)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$1(NodeTestTask.java:166)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:139)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$0(NodeTestTask.java:164)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:74)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:163)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:116)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:36)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:52)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:58)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.executeEngine(EngineExecutionOrchestrator.java:256)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.failOrExecuteEngine(EngineExecutionOrchestrator.java:228)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:189)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:109)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:66)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:168)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:65)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:126)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:100)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:57)
	at org.junit.platform.launcher.core.InterceptingLauncher.lambda$execute$0(InterceptingLauncher.java:46)
	at org.junit.platform.launcher.core.ClasspathAlignmentCheckingLauncherInterceptor.intercept(ClasspathAlignmentCheckingLauncherInterceptor.java:25)
	at org.junit.platform.launcher.core.InterceptingLauncher.execute(InterceptingLauncher.java:45)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:57)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:76)
	at groovy.junit6.plugin.ForkedJvmTestRunner.main(ForkedJvmTestRunner.java:111)

1 error

	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:351)
	at org.codehaus.groovy.control.ErrorCollector.addException(ErrorCollector.java:198)
	at org.codehaus.groovy.control.SourceUnit.addException(SourceUnit.java:281)
	at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:461)
	at org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:427)
	at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:1204)
	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:924)
	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:857)
	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:470)
	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:405)
	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:677)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:690)
	at groovy.lang.GroovyShell.parse(GroovyShell.java:702)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:553)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:590)
	at groovy.lang.GroovyShell.evaluate(GroovyShell.java:575)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:107)
	at groovy.test.GroovyAssert.assertScript(GroovyAssert.java:97)
	at groovy.grape.GrabResolverTest.testResolverDefinitionResolvesDependencyWithShorthand(GrabResolverTest.groovy:88)

	at groovy.junit6.plugin.ForkedJvmExtension.propagateOutcome(ForkedJvmExtension.java:256)
	at groovy.junit6.plugin.ForkedJvmExtension.runInForkedJvm(ForkedJvmExtension.java:118)
	at groovy.junit6.plugin.ForkedJvmExtension.interceptTestMethod(ForkedJvmExtension.java:100)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

Rerun Controls

Select tests to mute in this pull request:

  • GrabResolverTest > testResolverDefinitionResolvesDependency()
  • GrabResolverTest > testResolverDefinitionResolvesDependencyWithShorthand()

Reuse successful test results:

  • ♻️ Only rerun the tests that failed or were muted before

Click the checkbox to trigger a rerun:

  • Rerun jobs

Learn more about TestLens at testlens.app/docs.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.89744% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.2954%. Comparing base (494d161) to head (6ee1060).

Files with missing lines Patch % Lines
...ontracts/ast/visitor/AnnotationClosureVisitor.java 72.9730% 0 Missing and 10 partials ⚠️
...vy/contracts/generation/PreconditionGenerator.java 0.0000% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##               master      #3371        +/-   ##
==================================================
+ Coverage     75.2860%   75.2954%   +0.0095%     
- Complexity      49967      50000        +33     
==================================================
  Files            1775       1776         +1     
  Lines          163660     163731        +71     
  Branches        32301      32328        +27     
==================================================
+ Hits           123213     123282        +69     
  Misses          28947      28947                
- Partials        11500      11502         +2     
Files with missing lines Coverage Δ
.../ClosureExpressionEvaluationASTTransformation.java 93.9394% <100.0000%> (+0.2552%) ⬆️
...oovy/contracts/ast/visitor/ConfigurationSetup.java 100.0000% <100.0000%> (ø)
...che/groovy/contracts/generation/BaseGenerator.java 95.4546% <100.0000%> (+0.1420%) ⬆️
...y/contracts/generation/PostconditionGenerator.java 97.5000% <100.0000%> (+0.8898%) ⬆️
...rg/apache/groovy/contracts/util/OldProperties.java 100.0000% <100.0000%> (ø)
...vy/contracts/generation/PreconditionGenerator.java 83.8710% <0.0000%> (ø)
...ontracts/ast/visitor/AnnotationClosureVisitor.java 89.7638% <72.9730%> (-1.8060%) ⬇️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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