It depends upon the body testing you. If you happen to be an Olympic athlete, then you are most certainly going to fail the drug test. Anavar falls on the list of banned substances by the IOC, WADA, USADA and many other sports bodies, including MMA.
When it comes to the army, they don't really test for anabolic steroids. They test for other drugs such as marijuana, cocaine, amphetamines, opiates, etc. Why they don't test for such steroids is because such tests can be quite expensive.
Having said that, the army might test for such steroids if they expect the use of any steroids to be rife in any particular unit.
One of the best ways to get around such tests in the army is to have a prescription ready with you. For instance, if a soldier has low testosterone and has a prescription for TRT, his drug test might be accepted even if he tests positive.