Combine task preview test config and json into same file
Also auto generate the --task--preview-invalid output. Placing the
config in the same file as the output it generates helps correlate the
two to make it easier to debug and develop new tests.
Change-Id: I27255fb2f55401bf7b1362a4129ccef8a828c528
diff --git a/src/main/resources/Documentation/task.md b/src/main/resources/Documentation/task.md
index 8c1309e..eec28bc 100644
--- a/src/main/resources/Documentation/task.md
+++ b/src/main/resources/Documentation/task.md
@@ -530,5 +530,8 @@
Examples
--------
-See [task_states](task_states.html) for a comprehensive list of examples
+See [task_states](test/task_states.html) for a comprehensive list of examples
of task configs and their states.
+
+See what the results will look when [previewing](test/preview.html) a change
+to those states.
diff --git a/src/main/resources/Documentation/test/preview.md b/src/main/resources/Documentation/test/preview.md
new file mode 100644
index 0000000..e53b7d8
--- /dev/null
+++ b/src/main/resources/Documentation/test/preview.md
@@ -0,0 +1,603 @@
+[root "INVALIDS Preview"]
+ subtasks-file = invalids.config
+
+{
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "INVALIDS Preview",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "No PASS criteria",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "WAITING (subtask INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "WAITING (subtask duplicate)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "WAITING (subtask missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Grouping WAITING (subtask INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Grouping WAITING (subtask missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask Optional",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad PASS query",
+ "status" : "FAIL" # Only Test Suite: !invalid
+ "status" : "INVALID" # Only Test Suite: invalid
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad FAIL query",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad INPROGRESS query",
+ "status" : "FAIL" # Only Test Suite: !invalid
+ "status" : "INVALID" # Only Test Suite: invalid
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Looping",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (tasks-factory missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory type missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory type INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory duplicate)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "duplicate",
+ "status" : "FAIL"
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes type missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes invalid)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (tasks-factory changes loop)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "_change1_number",
+ "status" : "FAIL",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "_change2_number",
+ "status" : "FAIL",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
+
+[root "Root PASS Preview"]
+ pass = True
+
+{
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "Root PASS Preview",
+ "status" : "PASS"
+}
+
+[root "Root READY (subtask PASS) Preview"]
+ applicable = is:open
+ pass = NOT is:open
+ subtask = Subtask PASS Preview
+ ready-hint = You must now run the ready task
+
+[task "Subtask PASS Preview"]
+ applicable = is:open
+ pass = is:open
+
+{
+ "applicable" : true,
+ "hasPass" : true,
+ "hint" : "You must now run the ready task",
+ "name" : "Root READY (subtask PASS) Preview",
+ "status" : "READY",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "Subtask PASS Preview",
+ "status" : "PASS"
+ }
+ ]
+}
+
+[root "Subtasks External Preview"]
+ subtasks-external = user special Preview
+
+[external "user special Preview"]
+ user = testuser
+ file = special.config
+
+{
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtasks External Preview",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "userfile task/special.config PASS",
+ "status" : "PASS"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "userfile task/special.config FAIL",
+ "status" : "FAIL"
+ }
+ ]
+}
+
+[root "Root NA Pass Preview"]
+ applicable = NOT is:open
+ pass = True
+
+{
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "Root NA Pass Preview",
+ "status" : "PASS"
+}
+
+[root "NA INVALIDS Preview"]
+ applicable = NOT is:open
+ subtasks-file = invalids.config
+
+{
+ "applicable" : false,
+ "hasPass" : false,
+ "name" : "NA INVALIDS Preview",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "No PASS criteria",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "WAITING (subtask INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "WAITING (subtask duplicate)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "WAITING (subtask missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Grouping WAITING (subtask INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Grouping WAITING (subtask missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask INVALID",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Subtask Optional",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad PASS query",
+ "status" : "FAIL" # Only Test Suite: !invalid
+ "status" : "INVALID" # Only Test Suite: invalid
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad FAIL query",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : false,
+ "hasPass" : true,
+ "name" : "NA Bad INPROGRESS query",
+ "status" : "FAIL" # Only Test Suite: !invalid
+ "status" : "INVALID" # Only Test Suite: invalid
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "Looping",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (tasks-factory missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory type missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory type INVALID)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory duplicate)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "duplicate",
+ "status" : "FAIL"
+ },
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes type missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes missing)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (names-factory changes invalid)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : false,
+ "name" : "task (tasks-factory changes loop)",
+ "status" : "WAITING",
+ "subTasks" : [
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "_change1_number",
+ "status" : "FAIL",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ },
+ {
+ "applicable" : true,
+ "hasPass" : true,
+ "name" : "_change2_number",
+ "status" : "FAIL",
+ "subTasks" : [
+ {
+ "name" : "UNKNOWN",
+ "status" : "INVALID"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
diff --git a/src/main/resources/Documentation/task_states.md b/src/main/resources/Documentation/test/task_states.md
similarity index 100%
rename from src/main/resources/Documentation/task_states.md
rename to src/main/resources/Documentation/test/task_states.md
diff --git a/test/check_task_statuses.sh b/test/check_task_statuses.sh
index 419d7c8..2af771f 100755
--- a/test/check_task_statuses.sh
+++ b/test/check_task_statuses.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Copyright (C) 2021 The Android Open Source Project
#
@@ -43,6 +43,69 @@
remove_not_suite() { remove_suite !"$1" ; } # suite < pre_json > json
+# -------- Test Doc Format --------
+#
+# Test Doc Format has intermixed git config task definitions with json roots. This
+# makes it easy to define tests close to their outputs. Be aware that all of the
+# config will get consolidated into a single file, so non root config will be shared
+# amongst all the roots.
+#
+
+# Sample Test Doc for 2 roots:
+#
+# [root "Root PASS"]
+# pass = True
+#
+# {
+# "applicable" : true,
+# "hasPass" : true,
+# "name" : "Root PASS",
+# "status" : "PASS"
+# }
+#
+# [root "Root FAIL"]
+# fail = True
+#
+# {
+# <other root>
+# }
+
+# Strip the json from Test Doc formatted text. For the sample above, the output would be:
+#
+# [root "Root PASS"]
+# pass = True
+#
+# [root "Root FAIL"]
+# fail = True
+# ...
+#
+testdoc_2_cfg() { awk '/^\{/,/^$/ { next } ; 1' ; } # testdoc_format > task_config
+
+# Strip the git config from Test Doc formatted text. For the sample above, the output would be:
+#
+# { "plugins" : [
+# { "name" : "task",
+# "roots" : [
+# {
+# "applicable" : true,
+# "hasPass" : true,
+# "name" : "Root PASS",
+# "status" : "PASS"
+# },
+# {
+# <other root>
+# },
+# ...
+# }
+testdoc_2_pjson() { # < testdoc_format > pjson_task_roots
+ awk 'BEGIN { print "{ \"plugins\" : [ { \"name\" : \"task\", \"roots\" : [" }; \
+ end { print "}," ; end=0 }; \
+ /^\{/ { open=1 }; \
+ /^\}/ { open=0 ; end=1 }; \
+ open; \
+ END { print "}]}]}" }'
+}
+
# --------
gssh() { ssh -x -p "$PORT" "$SERVER" gerrit "$@" ; } # cmd [args]...
@@ -67,9 +130,9 @@
-e "s/_change$1_topic/$7/g"
}
-replace_default_changes() { # file
- local out=$(replace_change_properties "1" "${CHANGES[0]}" < "$1")
- echo "$out" | replace_change_properties "2" "${CHANGES[1]}" > "$1"
+replace_default_changes() {
+ replace_change_properties "1" "${CHANGES[0]}" | \
+ replace_change_properties "2" "${CHANGES[1]}"
}
replace_user() { # < text_with_testuser > text_with_$USER
@@ -83,7 +146,7 @@
}
example() { # example_num
- awk '/```/{Q++;E=(Q+1)/2};E=='"$1" < "$DOC_STATES" | grep -v '```' | replace_user
+ echo "$DOC_STATES" | awk '/```/{Q++;E=(Q+1)/2};E=='"$1" | grep -v '```' | replace_user
}
get_change_num() { # < gerrit_push_response > changenum
@@ -134,13 +197,6 @@
)
}
-query() { # query
- gssh query "$@" \
- --format json | head -1 | python -c "import sys, json; \
- print json.dumps(json.loads(sys.stdin.read()), indent=3, \
- separators=(',', ' : '), sort_keys=True)"
-}
-
query_plugins() { # query
gssh query "$@" --format json | head -1 | python -c "import sys, json; \
plugins={}; plugins['plugins']=json.loads(sys.stdin.read())['plugins']; \
@@ -172,7 +228,7 @@
readlink -f / &> /dev/null || readlink() { greadlink "$@" ; } # for MacOS
MYDIR=$(dirname -- "$(readlink -f -- "$0")")
-DOCS=$MYDIR/.././src/main/resources/Documentation
+DOCS=$MYDIR/.././src/main/resources/Documentation/test
OUT=$MYDIR/../target/tests
ALL=$OUT/All-Projects
@@ -181,7 +237,7 @@
USERS=$OUT/All-Users
USER_TASKS=$USERS/task
-DOC_STATES=$DOCS/task_states.md
+DOC_PREVIEW=$DOCS/preview.md
EXPECTED=$OUT/expected
STATUSES=$OUT/statuses
@@ -212,9 +268,7 @@
mkdir -p "$ALL_TASKS" "$USER_TASKS"
CHANGES=($(gssh query "status:open limit:2" | grep 'number:' | awk '{print $2}'))
-replace_default_changes "$DOC_STATES"
-replace_default_changes "$MYDIR/preview"
-replace_default_changes "$MYDIR/preview.invalid"
+DOC_STATES=$(replace_default_changes < "$DOCS/task_states.md")
example 1 |sed -e"s/current-user/$USER/" > "$ROOT_CFG"
example 2 > "$COMMON_CFG"
@@ -250,15 +304,22 @@
"$MYDIR"/strip_non_invalid.py < "$EXPECTED".applicable > "$EXPECTED".invalid-applicable
+
+testdoc_2_cfg < "$DOC_PREVIEW" | replace_user > "$ROOT_CFG"
+
+preview_pjson=$(testdoc_2_pjson < "$DOC_PREVIEW" | replace_default_changes)
+echo "$preview_pjson" | remove_suite invalid | json_pp > "$EXPECTED".preview
+echo "$preview_pjson" | remove_not_suite invalid | \
+ "$MYDIR"/strip_non_invalid.py > "$EXPECTED".preview-invalid
+
RESULT=0
query="change:$change3_number status:open"
test_generated applicable --task--applicable "$query"
test_generated all --task--all "$query"
-replace_user < "$MYDIR"/root.change > "$ROOT_CFG"
cnum=$(create_repo_change "$ALL" "$REMOTE_ALL" "$REF_ALL")
-test_file preview --task--preview "$cnum,1" --task--all "$query"
-test_file preview.invalid --task--preview "$cnum,1" --task--invalid "$query"
+test_generated preview --task--preview "$cnum,1" --task--all "$query"
+test_generated preview-invalid --task--preview "$cnum,1" --task--invalid "$query"
test_generated invalid --task--invalid "$query"
test_generated invalid-applicable --task--applicable --task--invalid "$query"
diff --git a/test/preview b/test/preview
deleted file mode 100644
index 235eaca..0000000
--- a/test/preview
+++ /dev/null
@@ -1,570 +0,0 @@
- "plugins" : [
- {
- "name" : "task",
- "roots" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "INVALIDS Preview",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "No PASS criteria",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "WAITING (subtask duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask Optional",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad PASS query",
- "status" : "FAIL"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad FAIL query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad INPROGRESS query",
- "status" : "FAIL"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Looping",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "duplicate",
- "status" : "FAIL"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes invalid)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory changes loop)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change1_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change2_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "Root PASS Preview",
- "status" : "PASS"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "hint" : "You must now run the ready task",
- "name" : "Root READY (subtask PASS) Preview",
- "status" : "READY",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "Subtask PASS Preview",
- "status" : "PASS"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtasks External Preview",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "userfile task/special.config PASS",
- "status" : "PASS"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "userfile task/special.config FAIL",
- "status" : "FAIL"
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "Root NA Pass Preview",
- "status" : "PASS"
- },
- {
- "applicable" : false,
- "hasPass" : false,
- "name" : "NA INVALIDS Preview",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "No PASS criteria",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "WAITING (subtask duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask Optional",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad PASS query",
- "status" : "FAIL"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad FAIL query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad INPROGRESS query",
- "status" : "FAIL"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Looping",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "duplicate",
- "status" : "FAIL"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes invalid)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory changes loop)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change1_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change2_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ],
diff --git a/test/preview.invalid b/test/preview.invalid
deleted file mode 100644
index 3f0c844..0000000
--- a/test/preview.invalid
+++ /dev/null
@@ -1,511 +0,0 @@
- "plugins" : [
- {
- "name" : "task",
- "roots" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "INVALIDS Preview",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "No PASS criteria",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "WAITING (subtask duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask Optional",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad PASS query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad FAIL query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad INPROGRESS query",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Looping",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes invalid)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory changes loop)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change1_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change2_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : false,
- "name" : "NA INVALIDS Preview",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "No PASS criteria",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "WAITING (subtask duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Grouping WAITING (subtask missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask INVALID",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Subtask Optional",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad PASS query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad FAIL query",
- "status" : "INVALID"
- },
- {
- "applicable" : false,
- "hasPass" : true,
- "name" : "NA Bad INPROGRESS query",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "Looping",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory type INVALID)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory duplicate)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes type missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes missing)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (names-factory changes invalid)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : false,
- "name" : "task (tasks-factory changes loop)",
- "status" : "WAITING",
- "subTasks" : [
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change1_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- },
- {
- "applicable" : true,
- "hasPass" : true,
- "name" : "_change2_number",
- "status" : "FAIL",
- "subTasks" : [
- {
- "name" : "UNKNOWN",
- "status" : "INVALID"
- }
- ]
- }
- ]
- }
- ]
- }
- ]
- }
- ],
diff --git a/test/root.change b/test/root.change
deleted file mode 100644
index 99dea09..0000000
--- a/test/root.change
+++ /dev/null
@@ -1,30 +0,0 @@
-[root "INVALIDS Preview"]
- subtasks-file = invalids.config
-
-[root "Root PASS Preview"]
- pass = True
-
-[root "Root READY (subtask PASS) Preview"]
- applicable = is:open
- pass = NOT is:open
- subtask = Subtask PASS Preview
- ready-hint = You must now run the ready task
-
-[root "Subtasks External Preview"]
- subtasks-external = user special Preview
-
-[root "Root NA Pass Preview"]
- applicable = NOT is:open
- pass = True
-
-[root "NA INVALIDS Preview"]
- applicable = NOT is:open
- subtasks-file = invalids.config
-
-[task "Subtask PASS Preview"]
- applicable = is:open
- pass = is:open
-
-[external "user special Preview"]
- user = testuser
- file = special.config