At the start of the COVID-19 pandemic, countries were encouraged by the World Health Organization to "Test. Test. Test." This article compares how Spain and the UK, facing a crisis of similar magnitude, established diagnostic testing systems that greatly differed in their organisation. We show how boundary work in each country, influenced by pre-existing institutional conditions, defined who could provide diagnostic testing and, crucially, who was excluded. Results show that enduring institutional conditions allowed clinical laboratory specialists to engage in boundary work, where these specialists had access to decision makers with formal authority, with the resulting testing system reflecting their professional logic. Where this was not the case, boundary work by others, based on the logic of efficiency, was influential in the organisation of testing. Our findings contribute to the understanding of the interplay between institutional conditions during a crisis - especially conditions regulating the territorial distribution of formal authority - and boundary work. In the UK, the high centralisation of authority over healthcare budgets allowed policy makers to implement a novel organisational solution involving newly built high-throughput labs. In Spain, devolved authority favoured local clinical laboratory specialists in their attempts to retain control of testing in their labs. Finally, the legacy of the pandemic response appears to be very different. In Spain, resources allocated to public hospital labs have improved their diagnostic capabilities. In the UK, the closure of newly built labs after the acute phase of the pandemic has left little infrastructural legacy and may have limited future pandemic preparedness.