-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 95f5a24
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package pipeline.rackhd.source_code | ||
|
||
def runTest(manifest_dict, repo_name){ | ||
/* | ||
manifest is a map contains manifest stash name and stash path: | ||
{"stash_name":xxx, | ||
"stash_path":xxx} | ||
repo_name is a String which is the name of the repository | ||
*/ | ||
def shareMethod = new pipeline.common.ShareMethod() | ||
String label_name="unittest" | ||
lock(label:label_name,quantity:1){ | ||
node_name = shareMethod.occupyAvailableLockedResource(label_name, []) | ||
node(node_name){ | ||
deleteDir() | ||
String on_build_config_dir = "$WORKSPACE/on-build-config" | ||
shareMethod.checkoutOnBuildConfig(on_build_config_dir) | ||
String manifest_name = manifest_dict["stash_name"] | ||
unstash "$manifest_name" | ||
String manifest_path = "$WORKSPACE/" + manifest_dict["stash_path"] | ||
def manifest = new pipeline.common.Manifest() | ||
String repo_dir = manifest.checkoutTargetRepo(manifest_path, repo_name, on_build_config_dir) | ||
try{ | ||
sh """#!/bin/bash -ex | ||
pushd $repo_dir | ||
./HWIMO-TEST | ||
popd | ||
""" | ||
} finally{ | ||
dir(repo_dir){ | ||
junit "*.xml" | ||
archiveArtifacts "*.xml" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
return this | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@Library('my_library') _ | ||
node{ | ||
timestamps{ | ||
def manifest = new pipeline.common.Manifest() | ||
def unit_test = new pipeline.rackhd.source_code.UnitTest() | ||
|
||
manifest.downloadManifest("https://dl.bintray.com/rackhd/binary/master-20170806","master-20170806") | ||
stash name: "prgate_manifest", includes: "master-20170806" | ||
manifest_dict = [:] | ||
manifest_dict["stash_name"] = "prgate_manifest" | ||
manifest_dict["stash_path"] = "master-20170806" | ||
stage("Unit Test"){ | ||
def unit_test_branches = [:] | ||
unit_test_branches["on-core"] = { | ||
unit_test.runTest(manifest_dict, "on-core") | ||
} | ||
unit_test_branches["on-tasks"] = { | ||
unit_test.runTest(manifest_dict, "on-tasks") | ||
} | ||
parallel unit_test_branches | ||
} | ||
} | ||
} |