serenity-bdd / serenity-maven-plugin

19 stars 21 forks source link

Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate failed: No environment configuration found for environment 'test' #72

Closed arustamov closed 5 years ago

arustamov commented 5 years ago

Hi @wakaleo I've migrated from version 2.0.55 to 2.0.67 and now experiencing the following issue running with -Denvrionment provided to maven:

mvn -e clean verify -Denvironment=test -Dcucumber.options="--tags @debug"

[ERROR] Failed to execute goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate (serenity-reports) on project fittriper-qa: Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate failed: No environment configuration found for environment 'test' -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate (serenity-reports) on project fittriper-qa: Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate failed: No environment configuration found for environment 'test' at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.0.67:aggregate failed: No environment configuration found for environment 'test' at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: net.serenitybdd.core.environment.UnknownEnvironmentException: No environment configuration found for environment 'test' at net.serenitybdd.core.environment.EnvironmentSpecificConfiguration.ensureSpecifiedEnvironmentConfigurationExistsFor (EnvironmentSpecificConfiguration.java:160) at net.serenitybdd.core.environment.EnvironmentSpecificConfiguration.environmentStrategyDefinedIn (EnvironmentSpecificConfiguration.java:133) at net.serenitybdd.core.environment.EnvironmentSpecificConfiguration.<init> (EnvironmentSpecificConfiguration.java:66) at net.serenitybdd.core.environment.EnvironmentSpecificConfiguration.from (EnvironmentSpecificConfiguration.java:125) at net.thucydides.core.steps.FilePathParser.valueDefinedIn (FilePathParser.java:41) at net.thucydides.core.steps.FilePathParser.getInstanciatedPath (FilePathParser.java:27) at net.thucydides.core.configuration.SystemPropertiesConfiguration.loadOutputDirectoryFromSystemProperties (SystemPropertiesConfiguration.java:91) at net.thucydides.core.configuration.SystemPropertiesConfiguration.getOutputDirectory (SystemPropertiesConfiguration.java:176) at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.configureOutputDirectorySettings (SerenityAggregatorMojo.java:127) at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.prepareExecution (SerenityAggregatorMojo.java:117) at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:183) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Running the same without -Denvironment provided works fine:

mvn clean verify -Dcucumber.options="--tags @debug"

Here is my environments section from serenity.conf:

`environments { default { webdriver.base.url = ""

user.base.url = "https://user.test.my.domain"

admin.base.url = "https://admin.test.my.domain" } dev { webdriver.base.url = ""

user.base.url = "https://user.dev.my.domain"
admin.base.url = "https://admin.dev.my.domain"

} test { webdriver.base.url = ""

user.base.url = "https://user.test.my.domain"
admin.base.url = "https://admin.test.my.domain"

} staging { webdriver.base.url = ""

user.base.url = "https://user.staging.my.domain"
admin.base.url = "https://admin.staging.my.domain"

} all { user.home.page = "#{user.base.url}" gym.admin.home.page = "#{gym.admin.base.url}" } }`

The plugin is defined like this:

`

net.serenity-bdd.maven.plugins
            <artifactId>serenity-maven-plugin</artifactId>
            <version>${serenity.version}</version>
            <dependencies>
                <dependency>
                    <groupId>net.serenity-bdd</groupId>
                    <artifactId>serenity-emailer</artifactId>
                    <version>${serenity.version}</version>
                </dependency>
            </dependencies>
            <configuration>
                <tags>${tags}</tags>
                <reports>email</reports>
            </configuration>
            <executions>
                <execution>
                    <id>serenity-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>`
talipkorkmaz commented 5 years ago

Im getting the same error on a docker image. The interesting part is on Windows there is no problem. Im passing the same arguements to maven on two os. Any idea?

arustamov commented 5 years ago

Works for me now in 2.0.69 fyi @wakaleo @talipkorkmaz