I'm trying to create a test which involves sending data to an external piece of hardware, rebooting that hardware, and asserting whether the hardware's data matches what was previously sent. This will be repeated 1000's of times, ultimately.
So the steps look like this:
- Query hardware for current running ID (the beforementioned data)
- Compare and assert it's still the same as id that was previously sent (or in the first test "id = 1)
- Create a new id (
id += 1), save it somewhere, and then send it to the hardware. - Repeat.
My question is how do I carry over this saved "id" between tests to compare? I was going to just read/write from a json as I've seen many people saying global variables are bad, but I'm not sure saving to a json is the best option.