Optimal distributed testing in high-dimensional Gaussian models