Skip to content

Commit

Permalink
Bug 1317928 - add valgrind to docker image; add test builds and mpi t…
Browse files Browse the repository at this point in the history
…est, r=ttaubert

Differential Revision: https://nss-review.dev.mozaws.net/D72

--HG--
extra : rebase_source : dd86f7130e03da74d2ba28938e0b9f718c6b6c30
  • Loading branch information
franziskuskiefer committed Nov 16, 2016
1 parent 92521eb commit 7bdede5
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 1 deletion.
3 changes: 3 additions & 0 deletions automation/taskcluster/docker/setup.sh
Expand Up @@ -25,6 +25,9 @@ apt_packages+=('lib32z1-dev')
apt_packages+=('gcc-multilib')
apt_packages+=('g++-multilib')

# ct-verif and sanitizers
apt_packages+=('valgrind')

# Latest Mercurial.
apt_packages+=('mercurial')
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 41BD8711B1F0EC2B0D85B91CF59CE3A8323293EE
Expand Down
54 changes: 54 additions & 0 deletions automation/taskcluster/graph/src/extend.js
Expand Up @@ -161,6 +161,8 @@ export default async function main() {

await scheduleFuzzing();

await scheduleTestBuilds();

await scheduleTools();

await scheduleLinux("Linux 32 (ARM, debug)", {
Expand Down Expand Up @@ -316,6 +318,58 @@ async function scheduleFuzzing() {
return queue.submit();
}

/*****************************************************************************/

async function scheduleTestBuilds() {
let base = {
platform: "linux64",
collection: "gyp",
group: "Test",
image: LINUX_IMAGE
};

// Build base definition.
let build = merge({
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && " +
"nss/automation/taskcluster/scripts/build_gyp.sh -g -v --test"
],
artifacts: {
public: {
expires: 24 * 7,
type: "directory",
path: "/home/worker/artifacts"
}
},
kind: "build",
symbol: "B",
name: "Linux 64 (debug, gyp, test)"
}, base);

// The task that builds NSPR+NSS.
let task_build = queue.scheduleTask(build);

// Schedule tests.
queue.scheduleTask(merge(base, {
parent: task_build,
name: "mpi",
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && nss/automation/taskcluster/scripts/run_tests.sh"
],
tests: "mpi",
cycle: "standard",
symbol: "mpi",
kind: "test"
}));

return queue.submit();
}


/*****************************************************************************/

async function scheduleWindows(name, base) {
Expand Down
6 changes: 5 additions & 1 deletion automation/taskcluster/graph/src/try_syntax.js
Expand Up @@ -35,7 +35,7 @@ function parseOptions(opts) {
let aliases = {"gtests": "gtest"};
let allUnitTests = ["bogo", "crmf", "chains", "cipher", "db", "ec", "fips",
"gtest", "lowhash", "merge", "sdr", "smime", "tools",
"ssl"];
"ssl", "mpi"];
let unittests = intersect(opts.unittests.split(/\s*,\s*/).map(t => {
return aliases[t] || t;
}), allUnitTests);
Expand Down Expand Up @@ -82,6 +82,10 @@ function filter(opts) {
// Filter unit tests.
if (task.tests) {
let found = opts.unittests.some(test => {
// TODO: think of something more intelligent here.
if (task.symbol.toLowerCase().startsWith("mpi") && test == "mpi") {
return true;
}
return (task.group || task.symbol).toLowerCase().startsWith(test);
});

Expand Down
40 changes: 40 additions & 0 deletions tests/mpi/mpi.sh
@@ -0,0 +1,40 @@
#! /bin/bash
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

mpi_init()
{
SCRIPTNAME="mpi.sh"
if [ -z "${INIT_SOURCED}" -o "${INIT_SOURCED}" != "TRUE" ] ; then
cd ../common
. ./init.sh
fi
SCRIPTNAME="mpi.sh"
html_head "MPI tests"
}

mpi_cleanup()
{
html "</TABLE><BR>"
cd ${QADIR}
. common/cleanup.sh
}

mpi_init
tests=($(mpi_tests list | awk '{print $1}'))
for test in "${tests[@]}"
do
OUT=$(mpi_tests $test 2>&1)
[ ! -z "$OUT" ] && echo "$OUT"
OUT=`echo $OUT | grep -i 'error\|Assertion failure'`

if [ -n "$OUT" ] ; then
html_failed "mpi $test test"
else
html_passed "mpi $test test"
fi
done

mpi_cleanup

0 comments on commit 7bdede5

Please sign in to comment.