Add tests for task visibility when previewing config updates

Tests for following kinds of updates are added. In each of these, we
assert that only tasks on refs visible to the current user are shown
and remaining tasks are shown as 'unknown' name and status.

1. --task-preview root file with subtasks-external pointing
   to secret user ref.
2. --task-preview root file with subtasks-external pointing
   to a non-secret user ref with subtasks-external pointing
   to a secret user ref.
3. --task-preview a non-secret user ref with subtasks-external
   pointing to secret user ref.
4. --task-preview a new root, original root with subtasks-external
   pointing to secret user ref.

Since helper functions are common with already existing test suite,
create a generic helper script in order to avoid duplication.

Originally-Authored-By: Adithya Chakilam
Change-Id: I6283f2d1f2f65f4f9abebe272690a8ccbf975e83
10 files changed