Skip to content

Commit

Permalink
fix container test no reports (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
MxEh-TT committed Jul 15, 2024
1 parent ec00562 commit e365c4b
Showing 1 changed file with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,12 @@ abstract class ETContainerTest extends ContainerTest {
def "Perform provide report logs step with no reports"() {
given: "a test execution pipeline"
String script = """
node {
withEnv(['ET_API_HOSTNAME=${etContainer.host}', 'ET_API_PORT=${etContainer.getMappedPort(ET_PORT)}']) {
ttRunPackage testCasePath: 'test.pkg'
ttProvideReportLogs()
}
}
""".stripIndent()
node {
withEnv(['ET_API_HOSTNAME=${etContainer.host}', 'ET_API_PORT=${etContainer.getMappedPort(ET_PORT)}']) {
ttProvideReportLogs()
}
}
""".stripIndent()
WorkflowJob job = jenkins.createProject(WorkflowJob.class, "pipeline")
job.setDefinition(new CpsFlowDefinition(script, true))
when: "scheduling a new build"
Expand All @@ -323,22 +322,23 @@ abstract class ETContainerTest extends ContainerTest {
jenkins.assertLogContains("[WARNING] No report files returned by ecu.test", run)
}

def "Perform provide report logs step with reports"() {
given: "a test execution pipeline"
String script = """
node {
withEnv(['ET_API_HOSTNAME=${etContainer.host}', 'ET_API_PORT=${etContainer.getMappedPort(ET_PORT)}']) {
ttProvideReportLogs()
}
}
""".stripIndent()
WorkflowJob job = jenkins.createProject(WorkflowJob.class, "pipeline")
job.setDefinition(new CpsFlowDefinition(script, true))
when: "scheduling a new build"
WorkflowRun run = jenkins.buildAndAssertStatus(Result.SUCCESS, job)
def "Perform provide report logs step with reports"() {
given: "a test execution pipeline"
String script = """
node {
withEnv(['ET_API_HOSTNAME=${etContainer.host}', 'ET_API_PORT=${etContainer.getMappedPort(ET_PORT)}']) {
ttRunPackage testCasePath: 'test.pkg'
ttProvideReportLogs()
}
}
""".stripIndent()
WorkflowJob job = jenkins.createProject(WorkflowJob.class, "pipeline")
job.setDefinition(new CpsFlowDefinition(script, true))
when: "scheduling a new build"
WorkflowRun run = jenkins.buildAndAssertStatus(Result.SUCCESS, job)

then: "expect successful test completion"
jenkins.assertLogContains("Providing ecu.test report logs to jenkins.", run)
jenkins.assertLogContains("Adding report logs to artifacts", run)
}
then: "expect successful test completion"
jenkins.assertLogContains("Providing ecu.test report logs to jenkins.", run)
jenkins.assertLogContains("Adding report logs to artifacts", run)
}
}

0 comments on commit e365c4b

Please sign in to comment.