-
Notifications
You must be signed in to change notification settings - Fork 11
Ability to test a validation plan without an existing device #609
Comments
As discussed, I think the easiest way of achieving this is to add the test device to the database inside a transaction that is then rolled back after the validation(s) are run. There are already interfaces in (the newly-refactored) Conch::ValidationSystem that allow running validations without saving results to the database. Unfortunately, I don't think I can make the transactional parts happen without more of the (still-underway) validation refactoring getting merged -- presently in master (v2.22), Conch::Pg is still being used in the last mile to fetch the subject device row, which will use a separate database connection and hence not see the device created inside the transaction. I will need to push Conch::Pg+Conch::Model::Device all the way out of the system first. (Good news though, that's not far off now.) |
Yeah, I expected this to be a long-term request. |
Necessary db work is now in, so this is no longer blocked. |
notes, to self if that's not obvious
So it really should just be a matter of:
I can test this by actually killing the main db connection entirely, which will result in an exception if any code anywhere at all tries to use a db connection other than the one we created a transaction on. |
Do you want to select the hardware_product_id and/or validation_plan that the report runs against, or just use the current hardcoded logic for determining these from report content? If the former, we might want an endpoint that looks like |
The latter. Just use the current hardcoded logic because that's what we'd have when we tried posting it anyway. |
The API has a way of testing a validation plan, given a device report blob. It requires the device to exist, however, because it needs to look up the device's hardware information and what not.
I need a way of testing a validation plan against a device that doesn't exist. For instance, we might be testing a new piece of hardware in the lab and need to see if it will pass our current validations. setting up test racks and all that fun is cumbersome and laborious.
I figure we'll at least need, for now, an existing SKU in the database and provide that identifier when we call this endpoint. While that's not as flexible as I'd really like, I think it's a reasonable entry barrier, particularly down the road if we fully apply the hardware specification json schemas we've been discussing.
The text was updated successfully, but these errors were encountered: