EDMONTON -- Oilsands giant Suncor Energy has won the latest round in its push to randomly test thousands of workers for drugs and alcohol in northern Alberta.

A Court of Queen's Bench judge has quashed a 2014 arbitration panel ruling that determined the proposed testing plan would violate the privacy of union workers.

The judge says the panel should have considered evidence about alcohol and drug incidents involving all workers at Suncor, including non-union contract employees.

Justice Blair Nixon says a new arbitration panel should review the company's random testing plan, which Suncor first announced in 2012.

Suncor Energy (TSX:SU) spokeswoman Sneh Seetal says the company is pleased with the ruling and that such testing aims to protect the safety of the public and workers.

Unifor local 707-A says it will appeal the judge's decision and maintains that random testing violates the basic rights of union members.