Retired LtCol here - they dont show up on a standard urinalysis so you’ll never pop during a random piss test or unit sweep. The only way they'll test for PEDs is if they have probable cause, and due to the legality surrounding that, you basically have to be caught with gear or, and this how they usually get people, fail a drug test for something else. Kind of weird but that’s how they do it. They can also “ask” you to take one, and there will probably be some unofficial coercion tied to that, but you can refuse - and/or the commander can order you take one, which can’t be used in a court martial.
Overall, you’re not likely to get tested unless you’re both super jacked and really stupid.