I added a test target to an existing SPM project. Running locally, everything worked, but in Docker, things stopped working. SPM said: "use the 'path' property in the Swift 4 manifest to set a custom target path". I added the path, and it still gave the same error message. It turned out that the problem wasn't Package.swift, but that I forgot to copy the "Tests" directory into my Docker image.
I imagine SPM could check if the path is specified but the directory doesn't exist, and then show a more appropriate message.