I think just putting your test somewhere that it gets rescued if it fails is all you need. But can’t you just test to see if something like DataExplorer.something exists?
I do not know enough about using migrations to have considered using them for your use case. You could also have an endpoint that, say, the admin panel called, and it would check that you have your queries installed.
Now that I’m thinking, I am afraid the only problem I actually solved is adding the other plugin so that tests can work.