-
Notifications
You must be signed in to change notification settings - Fork 69
Add first high-level integration test for Executor #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it, mocks the necessary parts but keeps us away from actually having to run an extensive campaign, which likely has many failure points.
However, it seems windows hates your test 😬
Yeah :( I'll try to see what I can do, but ... writing PowerShell? Probably not |
|
I guess writing it in go would work, although a little overkill 😬 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume the concern here is running the commands in CI, where we might not have a real Docker available?
I'm surprised there isn't a way to run Docker from within a GitHub Action: we can't be the first to have this issue. Nothing leaps off the page after some Googling, though.
I like this in general, though, and I don't want to let perfect be the enemy of good.
Yeah, exactly. And it's also nice that the tests are super fast to run. I'll try to see if I can find out how to run Docker in Docker in GitHub actions, but I was and am afraid that it's not easy to do without changing how we run containers in some way. |
* Add first high-level integration test for Executor * Exec bash process in dummydocker * Bump executor timeout to 5s in integration test * add docker.exec symlink for windows * Use OS-specific path separator when setting PATH * .exe to .bat * Try cd'ing into bat file directory * Skip integration test on windows
I present to you: the first high-level integration test to make sure that executing steps works.
Am I proud of this? Yes and no. Yes, because it gives me confidence that something works and it is a nice integration test. No, because, well, look, I created a little Docker "emulator" in Bash and I'm not sure how I feel about that now.
Edit: also, let me add: it creates a ZIP file in memory, mocks the Sourcegraph backend, actually runs commands in a temp directory and allows us to assert that changes were made to the files!