Flag parameter for management simulator to wait till scenario ends (#572)
* Add waitTillRolloutComplete parameter and setter for scenarios Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com> * Change to stream form parallel stream because of auth problems and fix delete rollout call Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com> * Changed back to parallelStream Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com> * Removed catch feign exception and added decode404 to feign client Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>
This commit is contained in:
committed by
Kai Zimmermann
parent
d78cfcd6ef
commit
68523cd8de
@@ -96,7 +96,7 @@ public class Application implements CommandLineRunner {
|
|||||||
final ObjectMapper mapper = new ObjectMapper()
|
final ObjectMapper mapper = new ObjectMapper()
|
||||||
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
.registerModule(new Jackson2HalModule());
|
.registerModule(new Jackson2HalModule());
|
||||||
return Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract())
|
return Feign.builder().contract(new IgnoreMultipleConsumersProducersSpringMvcContract()).decode404()
|
||||||
.requestInterceptor(
|
.requestInterceptor(
|
||||||
new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword()))
|
new BasicAuthRequestInterceptor(configuration.getUsername(), configuration.getPassword()))
|
||||||
.logger(new Slf4jLogger()).encoder(new FeignMultipartEncoder())
|
.logger(new Slf4jLogger()).encoder(new FeignMultipartEncoder())
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class ClientConfigurationProperties {
|
|||||||
*/
|
*/
|
||||||
public static class Scenario {
|
public static class Scenario {
|
||||||
private boolean cleanRepository;
|
private boolean cleanRepository;
|
||||||
|
private boolean waitTillRolloutComplete = true;
|
||||||
private int targets = 100;
|
private int targets = 100;
|
||||||
private int distributionSets = 10;
|
private int distributionSets = 10;
|
||||||
private int appModulesPerDistributionSet = 2;
|
private int appModulesPerDistributionSet = 2;
|
||||||
@@ -101,6 +102,14 @@ public class ClientConfigurationProperties {
|
|||||||
this.cleanRepository = cleanRepository;
|
this.cleanRepository = cleanRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isWaitTillRolloutComplete() {
|
||||||
|
return waitTillRolloutComplete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWaitTillRolloutComplete(final boolean waitTillRolloutComplete) {
|
||||||
|
this.waitTillRolloutComplete = waitTillRolloutComplete;
|
||||||
|
}
|
||||||
|
|
||||||
public int getRolloutDeploymentGroups() {
|
public int getRolloutDeploymentGroups() {
|
||||||
return rolloutDeploymentGroups;
|
return rolloutDeploymentGroups;
|
||||||
}
|
}
|
||||||
@@ -227,6 +236,10 @@ public class ClientConfigurationProperties {
|
|||||||
return scenarios;
|
return scenarios;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addScenarios(final Scenario scenario) {
|
||||||
|
scenarios.add(scenario);
|
||||||
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -278,11 +278,14 @@ public class ConfigurableScenario {
|
|||||||
// start the created Rollout
|
// start the created Rollout
|
||||||
rolloutResource.start(rolloutResponseBody.getRolloutId());
|
rolloutResource.start(rolloutResponseBody.getRolloutId());
|
||||||
|
|
||||||
waitUntilRolloutIsComplete(rolloutResponseBody.getRolloutId());
|
if (scenario.isWaitTillRolloutComplete()) {
|
||||||
|
waitUntilRolloutIsComplete(rolloutResponseBody.getRolloutId());
|
||||||
|
}
|
||||||
LOGGER.info("Run rollout for set {} -> Done", set.getDsId());
|
LOGGER.info("Run rollout for set {} -> Done", set.getDsId());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void waitUntilRolloutNoLongerExists(final Long id) {
|
private void waitUntilRolloutNoLongerExists(final Long id) {
|
||||||
|
|
||||||
do {
|
do {
|
||||||
try {
|
try {
|
||||||
TimeUnit.SECONDS.sleep(5);
|
TimeUnit.SECONDS.sleep(5);
|
||||||
|
|||||||
Reference in New Issue
Block a user