cypress job update

This commit is contained in:
Timo Bejan 2020-11-10 11:09:44 +02:00
parent cbd6573870
commit 566e2ac3e5

View File

@ -107,26 +107,26 @@ public class PlanSpec {
public Plan createCypressTestPlan() {
return new Plan(project(), "redaction-ui-tests", new BambooKey("REDCYPRESS"))
return new Plan(project(), "redaction-ui-tests", new BambooKey("UI-TESTS"))
.description("Cypress UI tests for redaction-ui.")
.stages(new Stage("UI Test Stage").jobs(createCypressJob("cypress")))
.stages(new Stage("UI Test Stage").jobs(createCypressJob()))
.linkedRepositories("RED / ui").triggers(new BitbucketServerTrigger()).planBranchManagement(
new PlanBranchManagement().createForVcsBranch()
.delete(new BranchCleanup().whenInactiveInRepositoryAfterDays(30)).notificationForCommitters());
}
private Job createCypressJob(String project) {
return new Job("Cypress Job: " + project, new BambooKey(project.toUpperCase().replaceAll("-", ""))).tasks(
private Job createCypressJob() {
return new Job("Cypress UI Tests Job", new BambooKey("UI-TESTS-CYPRESS")).tasks(
new VcsCheckoutTask().description("Checkout Default Repository")
.checkoutItems(new CheckoutItem().defaultRepository()),
new ScriptTask().description("Build").inlineBody(
"#!/bin/bash\n" + "set -e\n" + "imageName=\"nexus.iqser.com:5001/red/ui-" + project + "\"\n"
+ "dockerfileLocation=\"build/docker/" + project + "/Dockerfile\"\n"
"#!/bin/bash\n" + "set -e\n" + "imageName=\"nexus.iqser.com:5001/red/ui-cypress\"\n"
+ "dockerfileLocation=\"build/docker/cypress/Dockerfile\"\n"
+ "docker build -t ${imageName}:latest -f ${dockerfileLocation} .\n"),
new ScriptTask().description("Run Tests").inlineBody(
"#!/bin/bash\n" + "set -e\n" + "imageName=\"nexus.iqser.com:5001/red/ui-" + project + "\"\n"
"#!/bin/bash\n" + "set -e\n" + "imageName=\"nexus.iqser.com:5001/red/ui-cypress\"\n"
+ "docker run -v $PWD:/e2e -w /e2e ${imageName}:latest\n" + "sleep 10")
// for some reason disk isn't synced in real-time from docker