Files
firefox/tools/tryselect/test/setup.sh
T
Andrew Halberstadt 0bda560eb5 Bug 1509048 - [tryselect] Pass full taskgraph into selectors, r=marco
Currently selectors that generate the taskgraph receive a list of task labels
back. While this works, it isn't very robust and limits the selectors in what
they can accomplish.

For example, it means we need to use regexes to map test suites to tasks. If
we had the full taskgraph, we could use filter functions instead.

There are also new selectors in the works which will need this (like ./mach
try chooser). Finally the try syntax selector would also need this if we
ever migrate it to use the 'try_task_config.json' format.

Differential Revision: https://phabricator.services.mozilla.com/D12570
2018-11-23 18:17:33 +00:00

94 lines
1.9 KiB
Bash

export topsrcdir=$TESTDIR/../../../
export MOZBUILD_STATE_PATH=$TMP/mozbuild
export MACHRC=$TMP/machrc
cat > $MACHRC << EOF
[try]
default=syntax
EOF
calculate_hash='import hashlib, os, sys
print hashlib.sha256(os.path.abspath(sys.argv[1])).hexdigest()'
roothash=$(python -c "$calculate_hash" "$topsrcdir")
cachedir=$MOZBUILD_STATE_PATH/cache/$roothash/taskgraph
mkdir -p $cachedir
cat > $cachedir/target_task_graph << EOF
{
"test/foo-opt": {
"kind": "test",
"label": "test/foo-opt",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"test/foo-debug": {
"kind": "test",
"label": "test/foo-debug",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"build-baz": {
"kind": "build",
"label": "build-baz",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
}
}
EOF
cat > $cachedir/full_task_graph << EOF
{
"test/foo-opt": {
"kind": "test",
"label": "test/foo-opt",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"test/foo-debug": {
"kind": "test",
"label": "test/foo-debug",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"test/bar-opt": {
"kind": "test",
"label": "test/bar-opt",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"test/bar-debug": {
"kind": "test",
"label": "test/bar-debug",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
},
"build-baz": {
"kind": "build",
"label": "build-baz",
"attributes": {},
"task": {},
"optimization": {},
"dependencies": {}
}
}
EOF
# set mtime to the future so we don't re-generate tasks
find $cachedir -type f -exec touch -d "next day" {} +
export testargs="--no-push --no-artifact"