Skip to content

Conversation

@meinac
Copy link
Contributor

@meinac meinac commented Oct 9, 2017

During the development process, sometimes it makes sense to run only
the related tests of the file you've recently changed for speed.
By this change you can run only one test file, like so;

docker-compose run --rm -e TEST_FILE=tests/handlers/test_dashboards.py server tests

@meinac meinac force-pushed the make_test_run_configurable branch from 50cd347 to 63936ef Compare October 9, 2017 10:39
Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

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

It can be used to pass any argument/option to nosetsts; maybe we should give it a more generic name, like TEST_ARGUMENTS or something like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I think it's a good point, we can rename it as TEST_ARGS or TEST_ARGUMENTS but the variable has to be quoted like;
docker-compose run --rm -e TEST_ARGS="--process=4 tests/handlers/test_dashboards.py" server tests

Passing this argument will override the entire default arguments. The default one will be --with-coverage --cover-package=redash tests/

Does this make sense?

By setting TEST_ARGS environment variable with -e option of docker-compose
we can set nosetests options to run the tests as we want, like so;

`docker-compose run --rm -e TEST_ARGS="--with-coverage tests/handlers/test_dashboards.py" server tests`
@arikfr
Copy link
Member

arikfr commented Oct 9, 2017

Does this make sense?

Yes. :)

@meinac meinac force-pushed the make_test_run_configurable branch from 63936ef to b8d2df7 Compare October 9, 2017 14:17
@meinac
Copy link
Contributor Author

meinac commented Oct 9, 2017

Thanks for your quick response, I've updated the makefile as well as the commit message.

@arikfr arikfr merged commit 334e95a into getredash:master Oct 9, 2017
@arikfr
Copy link
Member

arikfr commented Oct 9, 2017

Thanks!

@meinac meinac deleted the make_test_run_configurable branch October 9, 2017 14:32
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.

2 participants