Skip to content

Commit

Permalink
let api handle missing file,adjust missing package test (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
MxEh-TT committed Aug 18, 2023
1 parent 318f1d3 commit 1af2762
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,9 @@ class CheckPackageStep extends Step {
@Override
CheckPackageResult call() throws RuntimeException,TimeoutException, IllegalArgumentException {
listener.logger.println("Executing Package Checks for: "+ filePath +" ...")
if (IOUtils.isAbsolute(filePath)) {
FilePath packagePath = new FilePath(launcher.getChannel(), filePath)
if (!packagePath.exists()) {
throw new IllegalArgumentException("ECU-TEST package at ${packagePath.getRemote()} does not exist!")
}
}
RestApiClient apiClient = new RestApiClient(envVars.get('ET_API_HOSTNAME'), envVars.get('ET_API_PORT'))
if (!apiClient.waitForAlive()) {
throw new TimeoutException("Timeout of ${timeout} seconds exceeded for connecting to ECU-TEST!")
throw new TimeoutException("Timeout was exceeded for connecting to ECU-TEST!")
}
CheckReport packageCheck = apiClient.runPackageCheck(filePath)
CheckPackageResult result = new CheckPackageResult( packageCheck.getSize(), packageCheck.getIssues())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ class ETContainerTest extends ContainerTest {
WorkflowRun run = jenkins.buildAndAssertStatus(Result.FAILURE, job)

then: "expect error"
println(run.getLog(100))
StringUtils.countMatches(jenkins.getLog(run),"Executing Package Checks for:") == 1
StringUtils.countMatches(jenkins.getLog(run),"IllegalArgumentException") == 1
StringUtils.countMatches(jenkins.getLog(run), "ApiException") == 1
StringUtils.countMatches(jenkins.getLog(run), "400") == 1
}
/*
TODO add invalid package to ecu-test workspace
Expand Down

0 comments on commit 1af2762

Please sign in to comment.