Skip to content

Conversation

rentzso
Copy link
Contributor

@rentzso rentzso commented Feb 3, 2016

@josschne Creating this PR to track work on enabling integration testing in travis

@josschne josschne force-pushed the integration-testing branch 7 times, most recently from 108aca3 to 2e88c16 Compare February 9, 2016 22:56
@josschne
Copy link
Contributor

josschne commented Feb 9, 2016

Ping @gsfr / @rentzso . I think we're ready to go with this. Please take a look.

Note that coverage through paster for the integration tests is a bit tricky. If we want to get those numbers we probably will need to refactor the integration tests to call the WSGI handler directly, see an example here: http://stackoverflow.com/questions/6222528/unittesting-the-webapp-requesthandler-in-gae-python

@gsfr gsfr changed the title adapt tests to the paster app server Add travis-based integration tests Feb 10, 2016
bin/run.sh Outdated


# Default config values
SCITRAN_CORE_INSECURE=${SCITRAN_CORE_INSECURE:-"true"}
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a needlessly dangerous default. Couldn't we just have Travis set the environment variable?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, we could do that. I thought this would be easier for newbies - the tests fail without this setting.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Why don't we have runtests.sh set this to true, but not run.sh itself?

@gsfr
Copy link
Member

gsfr commented Feb 10, 2016

Thanks, @josschne.

Would using uWSGI help with the coverage issue?

Tentatively LGTM, pending clarifications or minor updates on various line comments.

@andynemzek: Would appreciate a quick review of the diff on the two .sh files.

@josschne
Copy link
Contributor

Don't think using uWSGI would help with the coverage issue. In either case we need to enable coverage within the python environment, which can be done but is non-trivial. I'd like to focus on getting unit test coverage up and use the integration tests for their functional value, rather than any coverage.

.travis.yml Outdated
# to install python manually
# Python isn't supported OOTB, so pick a language that makes Travis happy
language: objective-c
os: osx
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we testing on OSX?
At most I'd expect us to matrix build against both linux and OSX.

Copy link
Contributor

Choose a reason for hiding this comment

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

This script assumes OSX - it uses brew. Would be nice to support multiple environments, but my understanding was we were limiting to OSX to start. Is that correct @gsfr?

Copy link
Member

Choose a reason for hiding this comment

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

That is correct. We wanted to get started with Travis asap and we had an OS X launcher.

@andynemzek
Copy link
Contributor

@gsfr didn't see anything pop out at me, but run.sh has grown quite a bit since I last worked on it.

.travis.yml Outdated
- brew update
- brew install python
before_script:
- bin/install.sh --ci
Copy link
Contributor

Choose a reason for hiding this comment

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

install.sh does not appear to take a --ci flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet... :)

@kofalt
Copy link
Contributor

kofalt commented Feb 10, 2016

I'm going to stop reviewing here, as it started to become clear that much of the script's non-portability pre-dates this PR. I played with it a bit, but... for now I'll just accept that I can't run the tests this way, and maybe we worry about that (and CI on linux) after this lands.

@josschne josschne changed the title Add travis-based integration tests Add travis-based integration tests - OSX only Feb 11, 2016
@kofalt
Copy link
Contributor

kofalt commented Feb 22, 2016

@gsfr @josschne What are the remaining blockers on getting this merged? No activity in awhile... I see one unanswered question (the first thread from the top).

@gsfr
Copy link
Member

gsfr commented Feb 22, 2016

Thanks for the ping, @kofalt. Joe and I are on it. No action needed at the moment.

@gsfr gsfr force-pushed the master branch 2 times, most recently from aaf2936 to d5f9db2 Compare February 26, 2016 22:00
@josschne josschne force-pushed the integration-testing branch 3 times, most recently from 0f93b08 to b18f029 Compare March 1, 2016 06:44
@josschne josschne force-pushed the integration-testing branch from bc5d1e2 to c2489e8 Compare March 5, 2016 20:54
@ryansanford
Copy link
Contributor

@gsfr @josschne

Looks like we could extend docker-compose.yml to include nginx to support https out of the box for this runtests entrypoint. Thoughts?

- sudo apt-get update -qq
- sudo apt-get -o Dpkg::Options::="--force-confnew" install -y -q docker-engine
- sudo curl -o /usr/local/bin/docker-compose -L https://github.com/docker/compose/releases/download/1.6.2/docker-compose-`uname -s`-`uname -m`
- sudo chmod +x /usr/local/bin/docker-compose
Copy link
Contributor

Choose a reason for hiding this comment

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

In general I prefer to keep the lines of vendor-specific CI files sparse, and instead throw these lines in a script where it's easier to document, maintain, and understand. bin/ci-install-docker-ecosystem.sh?

Not a blocker for merge.

@kofalt
Copy link
Contributor

kofalt commented Mar 7, 2016

And I'd like @kofalt's once-over just cause he's awesome

😎

This looks pretty great. At the architecture level, I question if we really need to boot virtualbox... I would have assumed we could use Travis' docker infra and just ran our containers on it. I'm assuming you've either already been down that road or decided it wasn't worth it. Either way, this approach is A-OK since it gets us that delicious green checkmark on PRs.

The test layout is a tad hairy but makes sense; I like the fixtures. Great work!

My read on the uwsgi config is that it probably won't affect us since we're using UWSGI in fast-cgi mode in prod, so I presume keepalive settings don't apply. Could be wrong!

@josschne
Copy link
Contributor

josschne commented Mar 7, 2016

@ryansanford @kofalt: Thanks for the review!

We only need to boot virtualbox on OSX (via docker-machine). The Travis CI tests are now running on Linux and assume docker is ready (Travis CI's OSX infra actually can't run virtualbox - which is where I got stuck).

Not sure on the uwsgi comments. @ryansanford thoughts? What's the best way to get the keepalive options into the mix without breaking prod?

@ryansanford I don't think http nor nginx are necessary here. I'm not sure I understood the motivation behind your comment.

@gsfr
Copy link
Member

gsfr commented Mar 8, 2016

Thanks, @josschne. Nice work!

I would like to still understand @ryansanford's comments before merging.

Also, we may want to bring this in line with the conflicting #185 before merging.

@josschne
Copy link
Contributor

josschne commented Mar 9, 2016

Ping @ryansanford. Can you provide more detail on your nginx comment?

@gsfr - Looks like integration with #185 could be a large change to this PR. Would it make sense to separate that from this PR?

@gsfr
Copy link
Member

gsfr commented Mar 9, 2016

Thanks, @josschne. After team discussion, we decided to go ahead with merging #185, which just happened. @ryansanford has committed to update this PR to fall inline with #185 as well as his latest infra.

@josschne
Copy link
Contributor

josschne commented Mar 9, 2016

@gsfr - Alright. I'll consider my part on this PR complete.

@kofalt
Copy link
Contributor

kofalt commented Mar 9, 2016

👍 😄 This is great stuff Joe, thanks!

@ryansanford ryansanford self-assigned this Mar 18, 2016
@ryansanford ryansanford force-pushed the integration-testing branch from d7575fd to 9118332 Compare March 18, 2016 20:12
@coveralls
Copy link

Coverage Status

Coverage remained the same at 8.008% when pulling 9118332 on integration-testing into fe7737d on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 8.008% when pulling 65e1553 on integration-testing into fe7737d on master.

@ryansanford
Copy link
Contributor

@gsfr Conflicts should be resolved, and travis build completes without error. Any final words before merging?

@gsfr
Copy link
Member

gsfr commented Mar 21, 2016

Thanks, @ryansanford. Let's have @rentzso and @nagem take a final look.

@rentzso
Copy link
Contributor Author

rentzso commented Mar 21, 2016

LGTM

1 similar comment
@nagem
Copy link
Contributor

nagem commented Mar 22, 2016

LGTM

@rentzso rentzso merged commit 2aa9153 into master Mar 22, 2016
@rentzso rentzso deleted the integration-testing branch March 22, 2016 23:07
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.

8 participants