-
Notifications
You must be signed in to change notification settings - Fork 207
ci(#4777): move several integration test classes #4778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
| package org.eolang.maven; | ||
|
|
||
| import com.jcabi.manifests.Manifests; | ||
| import com.yegor256.farea.Execution; | ||
| import com.yegor256.farea.Farea; | ||
| import java.io.IOException; | ||
| import org.cactoos.Scalar; | ||
|
|
||
| /** | ||
| * Configures the EO Maven plugin within a {@link Farea}. | ||
| * @since 0.52 | ||
| * @todo #4777:90min Continue moving integration tests from eo-maven-plugin to | ||
| * eo-integration-tests module. You can recognize these tests by the -IT suffix. | ||
| * They use Farea to run Maven builds with eo-maven-plugin. | ||
| * After moving all tests, remove the duplicated | ||
| * {@link AppendedPlugin} class from eo-maven-plugin module. | ||
| * Don't forget to remove exclusion from 'simian.yaml' as well. | ||
| */ | ||
| final class AppendedPlugin implements Scalar<Execution> { | ||
| /** | ||
| * The Farea object. | ||
| */ | ||
| private final Farea farea; | ||
|
|
||
| /** | ||
| * Ctor. | ||
| * @param farea The Farea | ||
| */ | ||
| AppendedPlugin(final Farea farea) { | ||
| this.farea = farea; | ||
| } | ||
|
|
||
| @Override | ||
| public Execution value() throws IOException { | ||
| return this.farea.build() | ||
| .plugins() | ||
| .append( | ||
| "org.eolang", | ||
| "eo-maven-plugin", | ||
| System.getProperty( | ||
| "eo.version", | ||
| Manifests.read("EO-Version") | ||
| ) | ||
| ).execution(); | ||
| } | ||
|
Comment on lines
+38
to
+49
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # Check for eo.version property definitions and EO-Version manifest references
rg "eo\.version" -C3Repository: objectionary/eo Length of output: 5843 🏁 Script executed: # Check for EO-Version manifest entries
rg "EO-Version" -C3Repository: objectionary/eo Length of output: 13757 🏁 Script executed: # Look for the Manifests class to understand how it reads manifest files
fd -e java | xargs rg -l "class Manifests|Manifests.read" | head -5Repository: objectionary/eo Length of output: 361 🏁 Script executed: # Check pom.xml for version properties and manifest configuration
find . -name "pom.xml" | xargs rg -l "eo.version|EO-Version" | head -5Repository: objectionary/eo Length of output: 99 🏁 Script executed: # Find and examine eo-integration-tests pom.xml for version and manifest configuration
find . -path "*/eo-integration-tests/pom.xml" -exec cat {} \;Repository: objectionary/eo Length of output: 8034 🏁 Script executed: # Find the Manifests class to understand how it reads manifest entries
fd -e java -type f | xargs rg -l "class Manifests|public static.*read"Repository: objectionary/eo Length of output: 231 🏁 Script executed: # Check if eo-integration-tests inherits system property from parent
find . -path "*/eo-integration-tests/pom.xml" -o -path "*/pom.xml" | head -1 | xargs cat | grep -A 20 "systemPropertyVariables"Repository: objectionary/eo Length of output: 41 🏁 Script executed: # Search for Manifests class definition and usage pattern
rg -l "class Manifests" --type=javaRepository: objectionary/eo Length of output: 41 🏁 Script executed: # Check the manifest file in eo-integration-tests test resources
cat eo-integration-tests/src/test/resources/META-INF/MANIFEST.MFRepository: objectionary/eo Length of output: 138 🏁 Script executed: # Verify that eo-integration-tests test manifest is accessible during tests
find eo-integration-tests -name "MANIFEST.MF" -o -name "pom.xml" | grep -E "test/resources|pom.xml"Repository: objectionary/eo Length of output: 194 🏁 Script executed: # Check if Maven filters test resources for eo-integration-tests
grep -r "filtering" eo-integration-tests/pom.xmlRepository: objectionary/eo Length of output: 41 🏁 Script executed: # Check the parent pom (eo-parent) for system property or resource configuration
find . -path "*/eo-parent/pom.xml" -exec head -100 {} \; | grep -A 30 "systemPropertyVariables"Repository: objectionary/eo Length of output: 41 🏁 Script executed: # Verify if the manifest placeholder is properly handled during build
rg "filtering.*true" eo-integration-testsRepository: objectionary/eo Length of output: 41 🏁 Script executed: # Find and examine the parent pom.xml (eo-parent)
find . -name "eo-parent" -type d -o -name "pom.xml" | xargs grep -l "eo-parent" | head -1 | xargs dirname | xargs find . -name "pom.xml" -path "*/eo-parent/*" | head -1 | xargs cat | head -150Repository: objectionary/eo Length of output: 177 🏁 Script executed: # Check how parent pom configures test resources and system properties
rg "eo-parent" -A 200 | head -100Repository: objectionary/eo Length of output: 4330 🏁 Script executed: # Look at the actual parent pom location
git ls-files | grep "pom.xml" | grep -i parentRepository: objectionary/eo Length of output: 41 🏁 Script executed: # Check if parent pom configures test resource filtering
cat pom.xml | grep -A 50 "build"Repository: objectionary/eo Length of output: 6664 🏁 Script executed: # Search for test resources configuration in parent or child
rg "testResources|filtering" pom.xml -A 5Repository: objectionary/eo Length of output: 41 🏁 Script executed: # Check if there are any issues or comments about the manifest in the codebase
rg "manifest|EO-Version" eo-integration-tests/pom.xml -C 5Repository: objectionary/eo Length of output: 377 🏁 Script executed: # Check if test resources are configured with filtering in any pom
rg "testResources" -A 10 pom.xml eo-integration-tests/pom.xmlRepository: objectionary/eo Length of output: 41 🏁 Script executed: # Check if Maven properties filtering is configured for the project
rg "maven-resources-plugin" -C 5Repository: objectionary/eo Length of output: 612 🏁 Script executed: # Check eo-maven-plugin's pom for system property configuration
cat eo-maven-plugin/pom.xml | grep -A 20 "systemPropertyVariables"Repository: objectionary/eo Length of output: 915 🏁 Script executed: # Verify the AppendedPlugin in eo-maven-plugin module to see if it inherits system property from there
cat eo-maven-plugin/src/test/java/org/eolang/maven/AppendedPlugin.java | head -60Repository: objectionary/eo Length of output: 1081 🏁 Script executed: # Check if there's a shared test base or superclass for AppendedPlugin
rg "class AppendedPlugin" -A 5 eo-maven-plugin/Repository: objectionary/eo Length of output: 591 Version resolution will fail in test execution due to unfiltered manifest placeholder. The Either configure Maven resource filtering to replace the placeholder in test resources, or add 🤖 Prompt for AI Agents |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
| package org.eolang.maven; | ||
|
|
||
| import java.io.IOException; | ||
| import java.nio.file.FileSystems; | ||
| import java.nio.file.Files; | ||
| import java.nio.file.Path; | ||
| import java.util.Arrays; | ||
| import org.hamcrest.Description; | ||
| import org.hamcrest.TypeSafeMatcher; | ||
|
|
||
| /** | ||
| * Asserting that path contains files matching provided globs. | ||
| * @since 0.31.0 | ||
| * @todo #4777:30min Remove {@link ContainsFiles} duplicate. | ||
| * We have exactly the same class in eo-maven-plugin module. | ||
| * We need to keep only one copy of this class and use it in both | ||
| * eo-maven-plugin and eo-integration-tests modules. | ||
| * Don't forget to remove exclusion from 'simian.yaml' as well. | ||
| */ | ||
| @SuppressWarnings({ | ||
| "JTCOP.RuleAllTestsHaveProductionClass", | ||
| "JTCOP.RuleCorrectTestName", | ||
| "JTCOP.RuleInheritanceInTests" | ||
| }) | ||
| final class ContainsFiles extends TypeSafeMatcher<Path> { | ||
| /** | ||
| * Patterns. | ||
| */ | ||
| private final String[] globs; | ||
|
|
||
| /** | ||
| * Ctor. | ||
| * @param glbs Patterns | ||
| */ | ||
| ContainsFiles(final String... glbs) { | ||
| this.globs = Arrays.copyOf(glbs, glbs.length); | ||
| } | ||
|
|
||
| @Override | ||
| public void describeTo(final Description description) { | ||
| description.appendText(String.format("Matching globs: %s", Arrays.toString(this.globs))); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean matchesSafely(final Path path) { | ||
| return Arrays.stream(this.globs) | ||
| .anyMatch( | ||
| glob -> ContainsFiles.matchesGlob( | ||
| path, | ||
| glob | ||
| ) | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * Returns whether a path matches a file pattern. | ||
| * @param item The path. | ||
| * @param glob The file pattern. | ||
| * @return True if the item matches the glob. | ||
| */ | ||
| private static boolean matchesGlob(final Path item, final String glob) { | ||
| try { | ||
| return Files.walk(item) | ||
| .anyMatch( | ||
| FileSystems | ||
| .getDefault() | ||
| .getPathMatcher( | ||
| String.format( | ||
| "glob:%s", | ||
| glob | ||
| ) | ||
| )::matches | ||
| ); | ||
| } catch (final IOException ex) { | ||
| throw new IllegalStateException( | ||
| String.format( | ||
| "Error while matching glob=`%s` for %s", | ||
| glob, | ||
| item | ||
| ), | ||
| ex | ||
| ); | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
| /** | ||
| * Integration tests for different eo-maven-plugin goals. | ||
| * In these tests we extensively use Farea framework to run some parts of eo-maven-plugin | ||
| * in a real Maven build. | ||
| */ | ||
| package org.eolang.maven; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exclusion patterns for AppendedPlugin.java and ContainsFiles.java should use path patterns (e.g., "**AppendedPlugin.java") to properly exclude files. The current syntax may not correctly match these files in subdirectories.