Adding ability to do a test run with test=True.

@rallytime @basepi 

Fixes #18966