Skip to content

Tests for query handler #10

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

Merged
merged 2 commits into from
May 3, 2018
Merged

Conversation

carlosms
Copy link
Contributor

@carlosms carlosms commented Apr 27, 2018

Part of #2.
Depends on #8, the only new commit is c58000f.

The tests require a working gitbase server and bblfshd server. gitbase should be serving at least this repo (https://github.com/src-d/gitbase-playground).

This will be added to the travis conf in the future, but meanwhile it can be done manually:

docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd
docker exec -it bblfshd bblfshctl driver install --all

go run cli/gitbase/main.go server --git=repos -v

@carlosms carlosms requested review from smacker and bzz April 27, 2018 11:27
@carlosms carlosms self-assigned this Apr 27, 2018
Copy link
Contributor

@smacker smacker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job!

@carlosms carlosms mentioned this pull request Apr 27, 2018
@bzz
Copy link
Contributor

bzz commented Apr 27, 2018

@carlosms could you help me understand, is this a set integration tests that would make go test fail if no bblfsh/gitbase is running and functionally equivalent to some series of CURL commands?

Would it be possible to separate tests, that depend on external infrastructure (even local) and have them behind a flag, off by default? In my experience, from developer productivity standpoint, it's usually is very nice when the default way of running tests "just runs" quickly.

Sorry if I misunderstood something!

Another thing is - as development flow becomes more complex and to make the PR more self-contained, could you please also include a REAMDE.md file with a single section Development like

## Development
### Build
<commands how to build>
### Run
<commands how to run, assuming it's built>
### Run tests
<dependencies> (with links i.e [run Bblfsh](https://doc.bblf.sh/user/getting-started.html#running-with-docker-recommended))
<commands how run tests>

No need to wary about doc completeness, applying guidelines and explaining anything in english - at this point just a series of CLI commands would be more then enough and later this minimal work will refactored and find it's appropriate place in the overall project's documentation.

@carlosms
Copy link
Contributor Author

@bzz

@carlosms could you help me understand, is this a set integration tests that would make go test fail if no bblfsh/gitbase is running and functionally equivalent to some series of CURL commands?

Yes, exactly.

Would it be possible to separate tests, that depend on external infrastructure (even local) and have them behind a flag, off by default? In my experience, from developer productivity standpoint, it's usually is very nice when the default way of running tests "just runs" quickly.

Honestly I wouldn't go into this now, we don't even have a makefile. And so far these integration tests are the only ones we have. When we have more tests I think we could have two separate make commands for local and integration tests.

Let me know if you have something else in mind that can be done now.

Another thing is - as development flow becomes more complex and to make the PR more self-contained, could you please also include a REAMDE.md file with a single section Development like

## Development
### Build
<commands how to build>
### Run
<commands how to run, assuming it's built>
### Run tests
<dependencies> (with links i.e [run Bblfsh](https://doc.bblf.sh/user/getting-started.html#running-with-docker-recommended))
<commands how run tests>

No need to wary about doc completeness, applying guidelines and explaining anything in english - at this point just a series of CLI commands would be more then enough and later this minimal work will refactored and find it's appropriate place in the overall project's documentation.

Done in f07c127.

Copy link
Contributor

@bzz bzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me.

Thank you for care and detailed description at #10 (comment)

👍 for awesome doc template as well

although for me, having all tests that require external dependency behind the flag is the expected default behaviour, up to @carlosms - if that is something you want to add later, sounds good.

carlosms added 2 commits May 3, 2018 17:58
Signed-off-by: Carlos Martín <[email protected]>
Signed-off-by: Carlos Martín <[email protected]>
@carlosms carlosms force-pushed the http-proxy-tests branch from f07c127 to 8e8fd46 Compare May 3, 2018 15:59
@carlosms
Copy link
Contributor Author

carlosms commented May 3, 2018

although for me, having all tests that require external dependency behind the flag is the expected default behaviour, up to @carlosms - if that is something you want to add later, sounds good.

Merging. Let's keep that in mind when we work on CI.

@carlosms carlosms merged commit 1b0c406 into src-d:master May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants