Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Suggestion for extending documentation for codecov and docker #117

Open
Midnighter opened this issue Apr 9, 2018 · 2 comments
Open

Suggestion for extending documentation for codecov and docker #117

Midnighter opened this issue Apr 9, 2018 · 2 comments

Comments

@Midnighter
Copy link

I'm not a make expert so it might be obvious to others; I struggled a long time with the proper expansion of the ci_env variable. The following fixed it for me in my Makefile so maybe it's a useful addition to the documentation?

SHELL:=/bin/bash

test-travis:
	$(eval ci_env=$(shell bash <(curl -s https://codecov.io/env)))
	docker-compose run --rm $(ci_env)  web printenv
@anthonyhastings
Copy link

@Midnighter Thank you very much for sharing this. You bailed me out of a hole trying to implement this into a Makefile. It would definitely be a good idea to incorporate instructions on how to put this into a Makefile into the documentation.

@Midnighter
Copy link
Author

Glad it was of help to you 🙂 I must admit, though, that I switched to generating a coverage report inside and uploading it outside the container for most of my projects. Example:

## Run the tests and report coverage (see https://docs.codecov.io/docs/testing-with-docker).
shared := /tmp/coverage
test-travis:
	mkdir --parents "$(shared)"
	docker-compose run --rm -v "$(shared):$(shared)" \
		<container> pytest --cov-report \
		"xml:$(shared)/coverage.xml" --cov-report term --cov=<package>
	bash <(curl -s https://codecov.io/bash) -f "$(shared)/coverage.xml"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants
@Midnighter @anthonyhastings @drazisil @thomasrockhu and others