Bug 1839315: part 4) Link from `SheetLoadData::mWasAlternate` to spec. r=emilio DONTBUILD
[gecko.git] / tools / tryselect / test / setup.sh
blobc883ec6e8a0319a0e5b4531301595cea1621fa27
1 export topsrcdir=$TESTDIR/../../../
2 export MOZBUILD_STATE_PATH=$TMP/mozbuild
3 export MACH_TRY_PRESET_PATHS=$MOZBUILD_STATE_PATH/try_presets.yml
5 # This helps to find fzf when running these tests locally, since normally fzf
6 # would be found via MOZBUILD_STATE_PATH pointing to $HOME/.mozbuild
7 export PATH="$PATH:$HOME/.mozbuild/fzf/bin"
9 export MACHRC=$TMP/machrc
10 cat > $MACHRC << EOF
11 [try]
12 default=syntax
13 EOF
15 cmd="$topsrcdir/mach python -c 'from mach.util import get_state_dir; print(get_state_dir(specific_to_topsrcdir=True))'"
16 # First run local state dir generation so it doesn't affect test output.
17 eval $cmd > /dev/null 2>&1
18 # Now run it again to get the actual directory.
19 cachedir=$(eval $cmd)/cache/taskgraph
20 mkdir -p $cachedir
21 # Run `mach try --help` to generate virtualenv.
22 eval "$topsrcdir/mach try --help" > /dev/null 2>&1
24 cat > $cachedir/target_task_set << EOF
26 "test/foo-opt": {
27 "kind": "test",
28 "label": "test/foo-opt",
29 "attributes": {},
30 "task": {},
31 "optimization": {},
32 "dependencies": {}
34 "test/foo-debug": {
35 "kind": "test",
36 "label": "test/foo-debug",
37 "attributes": {},
38 "task": {},
39 "optimization": {},
40 "dependencies": {}
42 "build-baz": {
43 "kind": "build",
44 "label": "build-baz",
45 "attributes": {},
46 "task": {},
47 "optimization": {},
48 "dependencies": {}
51 EOF
53 cat > $cachedir/full_task_set << EOF
55 "test/foo-opt": {
56 "kind": "test",
57 "label": "test/foo-opt",
58 "attributes": {},
59 "task": {},
60 "optimization": {},
61 "dependencies": {}
63 "test/foo-debug": {
64 "kind": "test",
65 "label": "test/foo-debug",
66 "attributes": {},
67 "task": {},
68 "optimization": {},
69 "dependencies": {}
71 "test/bar-opt": {
72 "kind": "test",
73 "label": "test/bar-opt",
74 "attributes": {},
75 "task": {},
76 "optimization": {},
77 "dependencies": {}
79 "test/bar-debug": {
80 "kind": "test",
81 "label": "test/bar-debug",
82 "attributes": {},
83 "task": {},
84 "optimization": {},
85 "dependencies": {}
87 "build-baz": {
88 "kind": "build",
89 "label": "build-baz",
90 "attributes": {},
91 "task": {},
92 "optimization": {},
93 "dependencies": {}
96 EOF
98 # set mtime to the future so we don't re-generate tasks
99 find $cachedir -type f -exec touch -d "next day" {} +
101 export testargs="--no-push --no-artifact"