The drug tests I do are all urine tests , which means, for example, marijuana would be detected from approx a month beforehand. So it is best not to do drugs at all, and there is no chance of being declared a drug user.
If you have taken pain killers which probably contain codeine or opiates, you get a chance to declare that. It is all fair and designed to protect employees from a drug influenced co-worker, given that heavy earth moving equipment is involved , and accidents could mean death.
I rip off part of the label of any prescription, or over the counter painkiller type drugs , and staple them to my notebook in my crib bag, and that way it is easy to declare when required to do a drug test.
No one is immediately sacked if caught , they are taken home , and not allowed back until they provide a clear drug test.
3 strikes and out.
Those that have been previously caught and are back at work, are not given a chance on the marbles , they are automatically required to be tested. After 12 months they can be marble candidates again.
Occasionally it is a blanket test , whereby all on site are tested.