use of io.syndesis.qe.resource.impl.Syndesis in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method updateCustomResource.
@When("update CR with {string} file")
public void updateCustomResource(String file) {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
syndesis.editCr(getCrFromFileAsString(file));
}
use of io.syndesis.qe.resource.impl.Syndesis in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method checkJaeger.
@Then("^check that jaeger pod \"([^\"]*)\" (is|is not) collecting metrics for integration \"([^\"]*)\"$")
public void checkJaeger(String jaegerPodName, String shouldCollect, String integrationName) {
TestUtils.sleepIgnoreInterrupt(30000L);
LocalPortForward lpf = OpenShiftUtils.createLocalPortForward(OpenShiftUtils.getPod(p -> p.getMetadata().getName().startsWith(jaegerPodName)), 16686, 16686);
final String integrationId = integrations.getIntegrationId(integrationName).get();
// host for default syndesis-jaeger
String host = "localhost:16686";
if (ResourceFactory.get(Syndesis.class).containsAddonProperty(Addon.JAEGER, "collectorUri")) {
host = ResourceFactory.get(Jaeger.class).getQueryServiceHost();
}
JSONArray jsonData = new JSONObject(HTTPUtils.doGetRequest("http://" + host + "/api/traces?service=" + integrationId).getBody()).getJSONArray("data");
OpenShiftUtils.terminateLocalPortForward(lpf);
if ("is".equals(shouldCollect)) {
assertThat(jsonData).size().isNotZero();
} else {
assertThat(jsonData).size().isZero();
}
}
use of io.syndesis.qe.resource.impl.Syndesis in project syndesis-qe by syndesisio.
the class OperatorValidationSteps method grantPermissions.
@Given("^grant permissions to user$")
public void grantPermissions() {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
syndesis.pullOperatorImage();
syndesis.grantPermissions();
}
use of io.syndesis.qe.resource.impl.Syndesis in project syndesis-qe by syndesisio.
the class UpgradeSteps method upgradeUsingOperator.
@When("^perform syndesis upgrade to newer version using operator$")
public void upgradeUsingOperator() {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
syndesis.defaultValues();
syndesis.pullOperatorImage();
syndesis.installCluster();
syndesis.grantPermissions();
syndesis.deployOperator();
}
use of io.syndesis.qe.resource.impl.Syndesis in project syndesis-qe by syndesisio.
the class CommonSteps method set3scaleEnvVar.
/**
* Enable or disable 3scale discovery of an API provided by Syndesis
*
* @param url URL of 3scale user interface or NULL for turning discovery off
*/
private void set3scaleEnvVar(String url) {
Syndesis syndesis = ResourceFactory.get(Syndesis.class);
JSONObject cr = new JSONObject(syndesis.getCr());
JSONObject features = cr.getJSONObject("spec").getJSONObject("components").getJSONObject("server").getJSONObject("features");
if (url != null) {
features.put("managementUrlFor3scale", url);
} else {
features.remove("managementUrlFor3scale");
}
syndesis.editCr(cr.toMap());
try {
OpenShiftWaitUtils.waitForPodIsReloaded("server");
} catch (InterruptedException | TimeoutException e) {
fail("Server was not reloaded after deployment config change", e);
}
// even though server is in ready state, inside app is still starting so we have to wait a lot just to be sure
try {
OpenShiftWaitUtils.waitFor(() -> OpenShiftUtils.getPodLogs("server").contains("Started Application in"), 1000 * 300L);
} catch (TimeoutException | InterruptedException e) {
fail("Syndesis server did not start in 300s with new variable", e);
}
PortForwardUtils.createOrCheckPortForward();
Selenide.refresh();
}
Aggregations