-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
add a maven-polyglot test using takari yaml extension #158
Conversation
…l extension addition of a profile to demo failing test, use `mvn -P failing verify` on the example project to run failing tests
First many thanks for your contribution. But I have some questions:
I have seen that you are changing the <execution>
<id>standard</id> This means you are adding a supplemental execution id which is already handled by Maven without supplemental configuration. So this does not really makes sense. If you take a look while building the whole project you can observe it like this:
The Furthermore you are changing the failsafe plugin and trying to cut it from the life cycle which results in not executing any kind of IT...which is not a good idea. This would mean not to execute any IT in the itf-example's project which I don't want to. In itf-example all IT's should run always... <artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>standard</id>
<phase>none</phase>
</execution> I'm not sure what the intention is to change the You can define profiles within an integration test via the @MavenJupiterExtension
public class PolyglotIT {
@MavenTest
void yaml_ok(MavenExecutionResult result) {
assertThat(result).isSuccessful();
}
@MavenTest
@MavenProfile("failing")
void yaml_fail(MavenExecutionResult result) {
assertThat(result).isFailure();
}
} Unfortunately I will not accept a change which is changing |
It was my intention, I don't know why I used AFAIK, to do the above, the default configuration of failsafe needs to be modified ; isn't it? |
Hi,
The integration tests will tell you: This test has failed which means your plugin/extension etc. which is under test does not behave as expected. (expressed by the test.) |
I know that the integration will fail ; and it is as it is the purpose to demo that ITF needs a modification to handle correctly core extensions and POM modifications on load. But if I PR an IT test that fails your build and break the CI I think you will not accept it neither. That's why I wanted to isolate the execution of this failing test in a different profile. If you have/know a better way of providing a failing test, please tell me I'll adapt the PR. |
In my opinion it is not expected to write the IT test with the opposite meaning ; ie consider the execution failure as an IT test success. |
closing in favor of the simplified (but failing the CI) #165 |
This is a simple contribution with an example of a test on a maven project using a core extension.
In this case, I used the polyglot-maven takari extension and more precisely the yaml polyglot one.
As the introduced tests demo that ITF does not support core extension manipulating the POM (as Object Model), I also introduced a profile for the introduced "Failing" test.
Normal commands will not be impacted and the failing tests are exlcluded from the normal build.
They have to be explicitly run by using the profile
failing
on the example project usingmvn -Pfailing verify