I don't know the details of what they test for but I'm in the Air Force and know guys who do it and haven't been caught yet. The guys I know of who were busted were distributing, in addition to using. Still a bad idea. I think the zero tolerance policy applies to all illegal
substances, so they could have legal cause to charge you criminally as well as non-judicially. I don't know the exact wording of the UCMJ, but as with anything in the military, they can always hit you with conduct unbecoming or discrediting the service depending on whether you're an O or an E.