You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just getting started trying to write a simple health check test using serenity/cucumber. This is my first time using either serenity or cucumber, so please forgive me and guide me, if I'm doing something wrong here.
This is a spring boot application packaged, tested, and deployed as a docker container. The base url of the service under test is dynamic, and specified with the environment variables DOCKER_HOST and DOCKER_PORT, as demonstrated in the above configuration.
The problem is when I run the test an error is reported by the serenity-maven-plugin in the aggregate goal in the post-integration-test phase of the execution identified by serenity-reports stating that the plugin
Could not resolve substitution value: ${DOCKER_HOST}
As demonstrated in the above configuration files, the DOCKER_HOST value is specified inside the maven-failsafe-plugin execution configuration as a systemPropertyVariables. It seems that at the time the serenity-maven-plugin is unable to access the environment variable as provided by the maven-failsafe-plugin while it is trying to configure things as specified in serenity.conf. However, if delete that specific part of the configuration that tries to use DOCKER_HOST from serenity.conf and instead inject EnvironmentVariables directly into my HealthCheckStepDefinitions class and get the property directly from EnvironmentVariables, the value DOCKER_HOST does exist and has the correct value as I specified from the pom.xml file. Here is the pertinent output from mvn clean install -X:
[INFO] --- maven-failsafe-plugin:2.22.0:integration-test (integration-tests) @ campaign-manager-integration-tests ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.overstock.osp.campaignmanager.CucumberIntegrationTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 s <<< FAILURE! - in com.overstock.osp.campaignmanager.CucumberIntegrationTest
[ERROR] initializationError Time elapsed: 0.005 s <<< ERROR!
com.google.inject.ProvisionException:
Unable to provision, see the following errors:
1) Error in custom provider, com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/campaign-manager-integration-tests/./src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables(ThucydidesModule.java:78)
while locating net.thucydides.core.util.EnvironmentVariables
1 error
Caused by: com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/campaign-manager-integration-tests/./src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] CucumberIntegrationTest » Provision Unable to provision, see the following err...
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:30 min
[INFO] Finished at: 2020-02-17T09:59:37-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.1.6:aggregate (serenity-reports) on project campaign-manager-integration-tests: Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.1.6:aggregate failed: Unable to provision, see the following errors:
[ERROR]
[ERROR] 1) Error in custom provider, com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/./campaign-manager-integration-tests/src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
[ERROR] at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables(ThucydidesModule.java:78)
[ERROR] while locating net.thucydides.core.util.EnvironmentVariables
[ERROR] for the 1st parameter of net.thucydides.core.configuration.SystemPropertiesConfiguration.<init>(SystemPropertiesConfiguration.java:68)
[ERROR] while locating net.thucydides.core.configuration.SystemPropertiesConfiguration
[ERROR] at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:52)
[ERROR] while locating net.thucydides.core.webdriver.Configuration
[ERROR]
[ERROR] 1 error
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.1.6:aggregate (serenity-reports) on project campaign-manager-integration-tests: Execution serenity-reports of goal net.serenity-bdd.maven.plugins:serenity-maven-plugin:2.1.6:aggregate failed: Unable to provision, see the following errors:
1) Error in custom provider, com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/./campaign-manager-integration-tests/src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables(ThucydidesModule.java:78)
while locating net.thucydides.core.util.EnvironmentVariables
for the 1st parameter of net.thucydides.core.configuration.SystemPropertiesConfiguration.<init>(SystemPropertiesConfiguration.java:68)
while locating net.thucydides.core.configuration.SystemPropertiesConfiguration
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:52)
while locating net.thucydides.core.webdriver.Configuration
1 error
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:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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.1.6:aggregate failed: Unable to provision, see the following errors:
1) Error in custom provider, com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/./campaign-manager-integration-tests/src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables(ThucydidesModule.java:78)
while locating net.thucydides.core.util.EnvironmentVariables
for the 1st parameter of net.thucydides.core.configuration.SystemPropertiesConfiguration.<init>(SystemPropertiesConfiguration.java:68)
while locating net.thucydides.core.configuration.SystemPropertiesConfiguration
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:52)
while locating net.thucydides.core.webdriver.Configuration
1 error
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:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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: com.google.inject.ProvisionException: Unable to provision, see the following errors:
1) Error in custom provider, com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/./campaign-manager-integration-tests/src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables(ThucydidesModule.java:78)
while locating net.thucydides.core.util.EnvironmentVariables
for the 1st parameter of net.thucydides.core.configuration.SystemPropertiesConfiguration.<init>(SystemPropertiesConfiguration.java:68)
while locating net.thucydides.core.configuration.SystemPropertiesConfiguration
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:52)
while locating net.thucydides.core.webdriver.Configuration
1 error
at com.google.inject.internal.InternalProvisionException.toProvisionException (InternalProvisionException.java:226)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1053)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.getConfiguration (SerenityAggregatorMojo.java:152)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.configureOutputDirectorySettings (SerenityAggregatorMojo.java:128)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.prepareExecution (SerenityAggregatorMojo.java:118)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:182)
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:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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: com.typesafe.config.ConfigException$UnresolvedSubstitution: /home/ehuntington/projects/osp/campaign-manager/./campaign-manager-integration-tests/src/test/resources/serenity.conf: 8: Could not resolve substitution to a value: ${DOCKER_HOST}
at com.typesafe.config.impl.ConfigReference.resolveSubstitutions (ConfigReference.java:108)
at com.typesafe.config.impl.ResolveContext.realResolve (ResolveContext.java:179)
at com.typesafe.config.impl.ResolveContext.resolve (ResolveContext.java:142)
at com.typesafe.config.impl.ConfigConcatenation.resolveSubstitutions (ConfigConcatenation.java:205)
at com.typesafe.config.impl.ResolveContext.realResolve (ResolveContext.java:179)
at com.typesafe.config.impl.ResolveContext.resolve (ResolveContext.java:142)
at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow (SimpleConfigObject.java:379)
at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow (SimpleConfigObject.java:312)
at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions (SimpleConfigObject.java:398)
at com.typesafe.config.impl.ResolveContext.realResolve (ResolveContext.java:179)
at com.typesafe.config.impl.ResolveContext.resolve (ResolveContext.java:142)
at com.typesafe.config.impl.SimpleConfigObject$ResolveModifier.modifyChildMayThrow (SimpleConfigObject.java:379)
at com.typesafe.config.impl.SimpleConfigObject.modifyMayThrow (SimpleConfigObject.java:312)
at com.typesafe.config.impl.SimpleConfigObject.resolveSubstitutions (SimpleConfigObject.java:398)
at com.typesafe.config.impl.ResolveContext.realResolve (ResolveContext.java:179)
at com.typesafe.config.impl.ResolveContext.resolve (ResolveContext.java:142)
at com.typesafe.config.impl.ResolveContext.resolve (ResolveContext.java:231)
at com.typesafe.config.impl.SimpleConfig.resolveWith (SimpleConfig.java:74)
at com.typesafe.config.impl.SimpleConfig.resolve (SimpleConfig.java:64)
at com.typesafe.config.impl.SimpleConfig.resolve (SimpleConfig.java:59)
at com.typesafe.config.impl.SimpleConfig.resolve (SimpleConfig.java:37)
at net.thucydides.core.util.PropertiesFileLocalPreferences.typesafeConfigPreferencesInCustomDefinedConfigFile (PropertiesFileLocalPreferences.java:100)
at net.thucydides.core.util.PropertiesFileLocalPreferences.loadPreferences (PropertiesFileLocalPreferences.java:63)
at net.thucydides.core.util.SystemEnvironmentVariables.createEnvironmentVariables (SystemEnvironmentVariables.java:196)
at net.thucydides.core.guice.ThucydidesModule.provideEnvironmentVariables (ThucydidesModule.java:78)
at net.thucydides.core.guice.ThucydidesModule$$FastClassByGuice$$a52485fb.invoke (<generated>)
at com.google.inject.internal.ProviderMethod$FastClassProviderMethod.doProvision (ProviderMethod.java:264)
at com.google.inject.internal.ProviderMethod.doProvision (ProviderMethod.java:173)
at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.provision (InternalProviderInstanceBindingImpl.java:185)
at com.google.inject.internal.InternalProviderInstanceBindingImpl$CyclicFactory.get (InternalProviderInstanceBindingImpl.java:162)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.SingleParameterInjector.inject (SingleParameterInjector.java:42)
at com.google.inject.internal.SingleParameterInjector.getAll (SingleParameterInjector.java:65)
at com.google.inject.internal.ConstructorInjector.provision (ConstructorInjector.java:113)
at com.google.inject.internal.ConstructorInjector.construct (ConstructorInjector.java:91)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get (ConstructorBindingImpl.java:306)
at com.google.inject.internal.FactoryProxy.get (FactoryProxy.java:62)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get (ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get (SingletonScope.java:168)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get (InternalFactoryToProviderAdapter.java:39)
at com.google.inject.internal.InjectorImpl$1.get (InjectorImpl.java:1050)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.getConfiguration (SerenityAggregatorMojo.java:152)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.configureOutputDirectorySettings (SerenityAggregatorMojo.java:128)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.prepareExecution (SerenityAggregatorMojo.java:118)
at net.serenitybdd.maven.plugins.SerenityAggregatorMojo.execute (SerenityAggregatorMojo.java:182)
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:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
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)
serenity.conf
pom.xml
I'm just getting started trying to write a simple health check test using serenity/cucumber. This is my first time using either serenity or cucumber, so please forgive me and guide me, if I'm doing something wrong here.
This is a spring boot application packaged, tested, and deployed as a docker container. The base url of the service under test is dynamic, and specified with the environment variables DOCKER_HOST and DOCKER_PORT, as demonstrated in the above configuration.
The problem is when I run the test an error is reported by the
serenity-maven-plugin
in theaggregate
goal in thepost-integration-test
phase of the execution identified byserenity-reports
stating that the pluginAs demonstrated in the above configuration files, the DOCKER_HOST value is specified inside the
maven-failsafe-plugin
execution configuration as asystemPropertyVariables
. It seems that at the time theserenity-maven-plugin
is unable to access the environment variable as provided by the maven-failsafe-plugin while it is trying to configure things as specified inserenity.conf
. However, if delete that specific part of the configuration that tries to useDOCKER_HOST
fromserenity.conf
and instead injectEnvironmentVariables
directly into my HealthCheckStepDefinitions class and get the property directly fromEnvironmentVariables
, the valueDOCKER_HOST
does exist and has the correct value as I specified from the pom.xml file. Here is the pertinent output frommvn clean install -X
:This issue might be related to #1769.
The text was updated successfully, but these errors were encountered: