You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/12/09 10:50:42 UTC

[GitHub] [maven-integration-testing] mthmulders opened a new pull request #87: [MNG-7051] Test activation of non-existing profiles

mthmulders opened a new pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r565127397



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051NonExistingProfileActivationTest.java
##########
@@ -0,0 +1,94 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.io.IOException;
+
+public class MavenITmng7051NonExistingProfileActivationTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private static final String PROJECT_PATH = "/mng-7051-non-existing-profile-activation";
+
+    public MavenITmng7051NonExistingProfileActivationTest()
+    {
+        super( "[4.0.0-alpha-1,)" );
+    }
+
+    /**
+     * This test verifies that activating a non-existing profile breaks the build.
+     */
+    public void testActivatingNonExistingProfileBreaks() throws IOException, VerificationException
+    {
+        final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH );
+        final Verifier verifier = newVerifier( projectDir.getAbsolutePath() );
+
+        verifier.addCliOption( "-P" );
+        verifier.addCliOption( "non-existing-profile" );
+        verifier.setLogFileName( "test-breaking.txt" );
+
+        try
+        {
+            verifier.executeGoal( "validate" );
+            fail( "Activated a non-existing profile without ? prefix should break the build, but it didn't." );
+        }
+        catch ( VerificationException ve )
+        {
+            // Inspect the reason why the build broke.
+            verifier.verifyTextInLog( "The requested profile(s) \"non-existing-profile\" could not be activated or de-activated because they do not exist." );

Review comment:
       Nice find. I have added the severity prefixes.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#issuecomment-770399525


   > I wen't through all tests. While the actual test if fine, I am absolutely not convinced in the test copies because they are 95% identical. There are now two ways to solve it:
   > 
   > * Modify the existing ones like I proposed (did already in other commits)
   > * If you still think they need to be separate, move/copy them in the the new test class along with resources then you have a compled test set.
   
   Alright, I've merged them in the original tests. Still not a fan, but it turned out better than I imagined.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] michael-o commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r565265806



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       My general rule of thumb is if the test has a different structure or requires 50+% in code modification then it needs to be copied. I need to take a closer look how the diff actually looks like.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] michael-o commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r567278148



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng2309ProfileInjectionOrder400Test.java
##########
@@ -0,0 +1,66 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-2309">MNG-2309</a>.
+ *
+ * @author Benjamin Bentmann
+ *
+ */
+public class MavenITmng2309ProfileInjectionOrder400Test

Review comment:
       Call me stupid, but this code looks almost identical to the previous one and the test resources are identical except the `profiles.xml`...

##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3732ActiveProfiles400Test.java
##########
@@ -0,0 +1,78 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3732">MNG-3732</a>.
+ *
+ * @author Benjamin Bentmann
+ */
+public class MavenITmng3732ActiveProfiles400Test

Review comment:
       This is virtually identical too.

##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4106InterpolationUsesDominantProfile400Test.java
##########
@@ -0,0 +1,70 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.util.Properties;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-4106">MNG-4106</a>.
+ *
+ * @author Benjamin Bentmann
+ *
+ */
+public class MavenITmng4106InterpolationUsesDominantProfile400Test

Review comment:
       Same here.

##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051NonExistingProfileActivationTest.java
##########
@@ -0,0 +1,94 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.io.IOException;
+
+public class MavenITmng7051NonExistingProfileActivationTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private static final String PROJECT_PATH = "/mng-7051-non-existing-profile-activation";

Review comment:
       the trailing summary isn't true since you have test for an existing profile in the last method.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r565122073



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       The original tests fail starting with the introduced optional behavior in Maven 4, that's why we copied the original testcase and slightly adjusted them (and appended 400 to the class name, meaning version 4.0.0).
   
   We have done this as well for the MavenITmng4262MakeLikeReactorDottedPathTest testcase in another feature on @rfscholte's advice.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] michael-o commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r565157126



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       Hmm, may ITs have an inline if for those cases. Why not use that style? It reduces the amount of code we have. Example: https://github.com/apache/maven-integration-testing/pull/96/files#diff-0323fd1cd7d6126ff8efaf53b1771bb88deb78c458141d38695979480c6710e5R58




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r565264028



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       My opinion is that those ifs can be useful in the tests when only a single thing has to be changed per version. 
   In the classes that we have duplicated we noticed that we would have to change the `.addCliOption` (which activates the profiles) everywhere and that these tests already contained big `if (mvnVersion < 3) `-branches which tested support for profiles.xml.
   
   So in this case my preference is to duplicate the test class to keep the tests readable and immutable (which was @rfscholte 's advice).
   
   It does increase the amount of code + tests indeed, but I don't think that outweighs the benefits listed above. 
   What do you think?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r567441629



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051NonExistingProfileActivationTest.java
##########
@@ -0,0 +1,94 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.io.IOException;
+
+public class MavenITmng7051NonExistingProfileActivationTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private static final String PROJECT_PATH = "/mng-7051-non-existing-profile-activation";

Review comment:
       Nice find. Fixed this as well. (classname + directory name)




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters merged pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters merged pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] michael-o commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r563393294



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       I am a bit confused by this. Some of the are already there, why they pop up here now and why have some disabled?

##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051NonExistingProfileActivationTest.java
##########
@@ -0,0 +1,94 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.io.IOException;
+
+public class MavenITmng7051NonExistingProfileActivationTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private static final String PROJECT_PATH = "/mng-7051-non-existing-profile-activation";
+
+    public MavenITmng7051NonExistingProfileActivationTest()
+    {
+        super( "[4.0.0-alpha-1,)" );
+    }
+
+    /**
+     * This test verifies that activating a non-existing profile breaks the build.
+     */
+    public void testActivatingNonExistingProfileBreaks() throws IOException, VerificationException
+    {
+        final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH );
+        final Verifier verifier = newVerifier( projectDir.getAbsolutePath() );
+
+        verifier.addCliOption( "-P" );
+        verifier.addCliOption( "non-existing-profile" );
+        verifier.setLogFileName( "test-breaking.txt" );
+
+        try
+        {
+            verifier.executeGoal( "validate" );
+            fail( "Activated a non-existing profile without ? prefix should break the build, but it didn't." );
+        }
+        catch ( VerificationException ve )
+        {
+            // Inspect the reason why the build broke.
+            verifier.verifyTextInLog( "The requested profile(s) \"non-existing-profile\" could not be activated or de-activated because they do not exist." );

Review comment:
       Make sure that you verify a warning with the `[WARNING]` prefix, some other ITs do this too.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters commented on pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters commented on pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#issuecomment-770436106


   @michael-o I added tests for the `!?` scenario.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] michael-o commented on a change in pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87#discussion_r563393294



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
##########
@@ -106,6 +106,10 @@ public static Test suite()
         // Tests that don't run stable and need to be fixed
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
+        suite.addTestSuite( MavenITmng4106InterpolationUsesDominantProfile400Test.class );

Review comment:
       I am a bit confused by this. Some of the are already there, why they pop up here now and why have some disabled?

##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng7051NonExistingProfileActivationTest.java
##########
@@ -0,0 +1,94 @@
+package org.apache.maven.it;
+
+/*
+ * 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
+ *
+ *   http://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.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+import java.io.IOException;
+
+public class MavenITmng7051NonExistingProfileActivationTest
+        extends AbstractMavenIntegrationTestCase
+{
+    private static final String PROJECT_PATH = "/mng-7051-non-existing-profile-activation";
+
+    public MavenITmng7051NonExistingProfileActivationTest()
+    {
+        super( "[4.0.0-alpha-1,)" );
+    }
+
+    /**
+     * This test verifies that activating a non-existing profile breaks the build.
+     */
+    public void testActivatingNonExistingProfileBreaks() throws IOException, VerificationException
+    {
+        final File projectDir = ResourceExtractor.simpleExtractResources( getClass(), PROJECT_PATH );
+        final Verifier verifier = newVerifier( projectDir.getAbsolutePath() );
+
+        verifier.addCliOption( "-P" );
+        verifier.addCliOption( "non-existing-profile" );
+        verifier.setLogFileName( "test-breaking.txt" );
+
+        try
+        {
+            verifier.executeGoal( "validate" );
+            fail( "Activated a non-existing profile without ? prefix should break the build, but it didn't." );
+        }
+        catch ( VerificationException ve )
+        {
+            // Inspect the reason why the build broke.
+            verifier.verifyTextInLog( "The requested profile(s) \"non-existing-profile\" could not be activated or de-activated because they do not exist." );

Review comment:
       Make sure that you verify a warning with the `[WARNING]` prefix, some other ITs do this too.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-integration-testing] MartinKanters merged pull request #87: [MNG-7051] Test activation of non-existing profiles

Posted by GitBox <gi...@apache.org>.
MartinKanters merged pull request #87:
URL: https://github.com/apache/maven-integration-testing/pull/87


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org