Skip to content

Commit 33203f9

Browse files
committed
fix: Address PR #186 review comments #15-19
Issue #15 & #16: Add @IgnoreIf for Maven availability - Added @IgnoreIf annotation to skip tests when Maven not configured - Tests require maven.home system property or MAVEN_HOME environment variable - Prevents test failures on machines without Maven or network access Issue #17: Fix typo 'occured' -> 'occurred' - Fixed typo in FlowErrorHandlerRuleTest error message Issue #18: Remove onlyIf from generateGDSL task - Removed onlyIf predicate that could cause stale GDSL output - Now relies on Gradle's inputs/outputs up-to-date checking only Issue #19: Add system property cleanup in EffectivePomIntegrationTest - Added testApp.cleanup() call before testApp.remove() to restore system properties - Prevents state leakage to subsequent tests All fixes verified with successful build.
1 parent 89ae0b7 commit 33203f9

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

mule-linter-core/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,10 @@ tasks.register('generateGDSL', JavaExec) {
2424
classpath += sourceSets.main.compileClasspath
2525
classpath += sourceSets.main.runtimeClasspath
2626

27-
// Incremental build - only run if template changes
27+
// Incremental build - rely on Gradle inputs/outputs up-to-date checking
2828
inputs.file(templateFile)
2929
inputs.dir(sourceSets.main.groovy.srcDirs)
3030
outputs.file(outputGdslFile)
31-
32-
// Only run when explicitly requested or when inputs change
33-
onlyIf {
34-
!outputGdslFile.exists() ||
35-
templateFile.lastModified() > outputGdslFile.lastModified()
36-
}
3731
}
3832

3933
// Wire GDSL generation to jar task (only runs if onlyIf condition is met)

mule-linter-core/src/test/groovy/com/avioconsulting/mule/linter/model/EffectivePomIntegrationTest.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ import com.avioconsulting.mule.linter.rule.pom.PomDependencyVersionRule
1414
import com.avioconsulting.mule.linter.rule.pom.PomExistsRule
1515
import com.avioconsulting.mule.linter.rule.pom.PomPluginAttributeRule
1616
import com.avioconsulting.mule.linter.rule.pom.PomPropertyValueRule
17+
import spock.lang.IgnoreIf
1718
import spock.lang.Specification
1819

1920
/**
2021
* Integration tests for effective POM resolution with parent POM inheritance.
2122
* Tests comprehensive parent-child sample for end-to-end validation of POM rules.
23+
*
24+
* NOTE: These tests require Maven to be available (maven.home system property or
25+
* MAVEN_HOME environment variable) and network access to resolve parent POMs.
26+
* Tests are skipped if Maven is not configured.
2227
*/
28+
@IgnoreIf({ !System.getProperty('maven.home') && !System.getenv('MAVEN_HOME') })
2329
@SuppressWarnings(['MethodName', 'MethodReturnTypeRequired', 'StaticFieldsBeforeInstanceFields'])
2430
class EffectivePomIntegrationTest extends Specification {
2531

@@ -30,6 +36,8 @@ class EffectivePomIntegrationTest extends Specification {
3036
}
3137

3238
def cleanup() {
39+
// Restore system properties before removing test app to avoid state leakage
40+
testApp.cleanup()
3341
testApp.remove()
3442
}
3543

mule-linter-core/src/test/groovy/com/avioconsulting/mule/linter/rule/configuration/FlowErrorHandlerRuleTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/cu
196196
\t\t<avio-logger:log doc:id="d5eb2fc2-e566-43fe-9a3f-e91426f3fda2" config-ref="topgolf-core-config" message="END: Get records from ACME system" category="${log.category}.examples" doc:name="END" correlation_id="#[correlationId]" logLocationInfo="true" />
197197
\t\t<error-handler >
198198
\t\t\t<on-error-continue enableNotifications="true" logException="true" doc:name="On Error Continue" doc:id="51bc12f9-1ec3-42b9-8bc4-90bdac19fa42" >
199-
\t\t\t\t<avio-logger:log doc:name="Log ERROR" doc:id="7362ee98-b097-4bb5-8ab8-c4329ec10a2a" config-ref="AVIO_Logger_Config" message="'Error occured in the flow"/>
199+
\t\t\t\t<avio-logger:log doc:name="Log ERROR" doc:id="7362ee98-b097-4bb5-8ab8-c4329ec10a2a" config-ref="AVIO_Logger_Config" message="'Error occurred in the flow"/>
200200
\t\t\t</on-error-continue>
201201
\t\t</error-handler>
202202
\t</flow>

0 commit comments

Comments
 (0)