A button is more clear labeled as an action or verb rather than a state... As other answers suggest "Publish test" is a good choice and would be what I would go for. The difficulty is the reverse operation... Is the operation truly symmetric?
It is difficult to avoid assuming what your users may have as a mental model of your application, so you might had to help them out and handhold them a bit so that they understand what it is they are doing...
Q: Why would they want to unpublish the test?
Is it because:
- They made a mistake and need to change it?
- This is how they terminate a test?
- Some other reason?
Whilst unpublishing the test would cover all cases, they are quite different from the perspective of the user. For each option there may be considerations and nuances that need to be taken into account. What happens when a test has been published and other users can access it? For other users who might be looking for this test after it has been published, they might need to be shown a message instead rather than just hiding the test... How does the operation fit into the bigger picture?
If so your undo action may become something like "Revoke test" to temporarily take the test down because it is erroneous or "End test" to close the test as finished might be more appropriate.