Tasks with or conditional (step == 1 or step == 0) were not showing up
in the step file.
To make sure we collect the tasks properly we refactor the filter
logic:
1. make all conditional a big string with no spaces and no Boolean
2. use findall to collect all the conditional step
3. if step found and it does belong to the current step add it.
4. if step found and it doesn't belong to the current step remove it.
5. if step condition not found, let strict decide.
6. if strict remove it else add it (default behavior)
We also add a unit test related to that filtering.
Backport unit tests were adjusted to accommodate the new interface to
_write_tasks_per_step[1]
[1] See I2781cae14663094d531ad70c3d412b3153b46612
Change-Id: I815443fa7cfd54c9884aff751caf701fd77a8f3a
Closes-Bug: #1887135
(cherry picked from commit 5493304944)
(cherry picked from commit 4c4ba31248)