A group headed by Canadian pension fund Ontario Municipal Employees Retirement System and Goldman Sachs Group Inc.’s infrastructure arm agreed Friday to buy a majority stake in Germany’s Amedes Holding GmbH, a provider of medical-diagnostic services including Covid-19 tests.

The deal valuation wasn’t disclosed. The Wall Street Journal reported earlier that the acquisition values the business at close to 1.6 billion euros including debt, equivalent to about $1.9 billion, citing people familiar with the matter.

Omers and Goldman, plus AXA Investment Managers—the asset-management business of global insurer AXA SA—are buying the controlling stake from European buyout firm Antin Infrastructure Partners.

Antin said the deal was expected to close by the end of this year.

Based in Hamburg, Germany, privately held Amedes offers diagnostic services for patients, resident doctors and clinics at laboratories and practices in Germany and Belgium. Its business handles PCR tests that are used to diagnose Covid-19.

The acquisition would allow the buyers to take advantage of strong demand for PCR diagnostic services. However, that business could be at risk of slowing if the rollout of vaccines successfully combats the virus’s spread.

The fight against Covid-19 has highlighted the importance of healthcare services. It has also shown how the definition of infrastructure has expanded beyond traditional assets such as toll roads and pipelines to include busing, aviation services and healthcare. The ability to generate steady recurring revenue is a common link between them.

Antin, which has headquarters in Paris, London and New York, acquired a majority stake in Amedes in 2015 from General Atlantic, a U.S.-based growth investor. Since then, the business has expanded its laboratory network from about 62 laboratories and practices to more than 70.

Focused on infrastructure assets in Europe and North America, Antin targets deals in the energy and environment, telecommunications, transportation and social sectors.

Write to Ben Dummett at ben.dummett@wsj.com