exercism / go-test-runner

GNU Affero General Public License v3.0
15 stars 17 forks source link

Investigate whether Scanln can be removed #59

Closed junedev closed 2 years ago

junedev commented 2 years ago

There is this bit in the test runner code: https://github.com/exercism/go-test-runner/blob/main/testrunner/extract.go#L34

It means that if you run the test runner outside of the docker container with the command from the README go run . testrunner/testdata/practice/passing outdir then you need to press enter a lot of times to actually get the output json file. We don't yet understand why it works correctly in the production setting. We want to find out how this works to decide whether the Scanln part can be removed or guarded by some flag to activate it only if needed.

mhmmdd commented 2 years ago

I wanted to know why this problem is occurred so I created a minimal repository. I understand that this is not caused by Golang, it comes from Docker attached mode issue.

junedev commented 2 years ago

@mhmmdd Thanks a lot for investigating this, very helpful!

So a bit exaggerated I would say "it accidentally works" in production because that waiting for input is ignored.

With that information and given that @ekingery who originally wrote that line told @andrerfcsantos he doesn't know why its there, I think we should remove it.

When we do, we should make sure that all 3 variants (outside of the docker container, inside attached mode, inside not attached) still work (see commands in the readme).