This paper is concerned with tests in multivariate time series models made up of random walk (with drift) and stationary components. When the stationary component is white noise, a Lagrange multiplier test of the hypothesis that the covariance matrix of the disturbances driving the multivariate random walk is null is shown to be locally best invariant, something that does not automatically follow in the multivariate case. The asymptotic distribution of the test statistic is derived for the general model. The test is then extended to deal with a serially correlated stationary component. The main contribution of the paper is to propose a test of the validity of a specified value for the rank of the covariance matrix of the disturbances driving the multivariate random walk. This rank is equal to the number of common trends, or levels, in the series. The test is very simple insofar as it does not require any models to be estimated, even if serial correlation is present. Its use with real data is illustrated in the context of a stochastic volatility model, and the relationship with tests in the cointegration literature is discussed.