Fix issues with combining -y with other args

The -y flag produces a false verification failure when combined with --dry-run or -g flags. This is because the test_commands var is assigned a list of command str in some cases, and a test name in other cases.

The -y flag relies on test_commands being assigned a test name, while the -g flag relies on it being a command str. They work fine separately, but cause a failure when combined.

The current behavior of -gu is also wrong. `atest HelloWorldTests -gu` will add to runner_commands.json and append test_commands.json without prompt.
Because it entered the "-g" / generate_runner_cmd flow first, test_name was subsequently used in the "-u" / update_cmd_mapping and updating the test_commands with an entry that has the whole command as the name of the test. The correct behavior is for the file to not be updated because the commands are expected to be the same.

This CL renames the variable to fix the bug and make the code more readable.

Bug: 313717371
Bug: 309036702
Test: m atest &&  atest-dev atest_unittests --host && atest-dev HelloWorldTests -yg && atest-dev HelloWorldTests -y --dry-run
Change-Id: I8f0e444e09edabed80de737223044de47b3cd344
2 files changed