Skip to content
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

Improved Testing #11

Closed
GochoMugo opened this issue Jan 3, 2015 · 4 comments
Closed

Improved Testing #11

GochoMugo opened this issue Jan 3, 2015 · 4 comments

Comments

@GochoMugo
Copy link
Contributor

There is an issue with running these tests. The username and password are hard-coded into the test script. This means that if anyone wants to run the tests, they would have do one of the following:

  1. hard-code their credentials into the test script
  2. create a user with same credentials as specified in the test-script

None of this is easy considering changing the test script would mean entirely different changes among collaborators. Also creating a user may not be possible, say on a CI server.

I suggest we use this approach: allow user running the test to create a credentials file, say named .credentials.yml that will be holds the username and password and that will be added to .gitignore to avoid checking it into git. If the user does not have such a file, particularly CI servers, we try use environment variables instead.

@firstprayer
Copy link
Owner

Good idea. Or to simplify this, we can search for the .credential file first (actually, why not just call test_settings.py? With this user can also specify the db host and username, dbname, etc). If the file is not found, use the default settings (as in the test script now). Setting environment variables is less easy. What do you think?

@GochoMugo
Copy link
Contributor Author

I now understand we need more configuration values apart from the username and password. Is using a python script file the best option in defining such values? I would suggest yaml

I suggest using environment variables as we prepare to add continuous integration such as Travis CI. This will allow tweaking only environment variables without touching the test script itself, in cases such as moving from a one CI service to another.

@firstprayer
Copy link
Owner

Huh...Interesting. I haven't used Travis CI before, but sounds a good idea.

I'll try to restructure the test script today. This piece of code will be published to the develop branch

@firstprayer
Copy link
Owner

I got the test scripts restructured. I use a yml file as the config file. It should be easier to test locally now.

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

No branches or pull requests

2 participants