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

Tests should be able to run without a config.json file #31

Closed
sylvestre opened this issue Oct 19, 2015 · 8 comments
Closed

Tests should be able to run without a config.json file #31

sylvestre opened this issue Oct 19, 2015 · 8 comments

Comments

@sylvestre
Copy link
Contributor

No description provided.

@anubnair
Copy link
Contributor

@sylvestre Test should run across all the function right? It needs api_key to call the apis. Any test api_key is available? If so, we dont need to use the config.json, rather we can hard cord this.

@anoopvalluthadam
Copy link
Contributor

@sylvestre https://github.com/sylvestre In most of the modules getting
it from config file, instead of that we can parse it in a common place and
pass it to the methods, which will help us when we import that modules in
to some other modules.

@sylvestre
Copy link
Contributor Author

I am not sure if a public api_key is available. I will ask.
For example, it is causing this failure:
https://travis-ci.org/mozilla/relman-auto-nag/builds/86781044

@sylvestre
Copy link
Contributor Author

I asked to @globau and the api_key must remain private. However, I think we could try the solution 3.
Otherwise, we have other solutions:

<glob> so.. the options i see for you are:
<glob> 1. use bugzilla-dev ( bugzilla-dev.allizom.org ).  be aware your api-key may be deleted at any time as that system is periodically refreshed.  api-keys should not be public
<glob> 2.  read-only tests against production.  api-keys should still not be public
<glob> 3. unauthenticated testing
<glob> 4. self-host minimal bmo instance, unlimited testing with not api-key privacy issues
<glob> running destructive tests against production (eg. creating test bugs) is a good way to get an account disabled (this has happened before!)
<glob> running destructive tests against bugzilla-dev is ok

@anoopvalluthadam
Copy link
Contributor

@sylvestre

Doubts regarding 4 points mentioned above:

  1. If we are using bugzilla-dev.allizom.org as API, we have to change the whole APIs in the code when testing( change the APIs to a settings file), since the APIs are not from a settings file.
  2. read-only tests against production: public API KEY!
  3. unauthenticated testing: How it works for bugzilla production API or any other APIs, still we need a KEY, isn't it?
  4. I didn't understand!

@anubnair
Copy link
Contributor

@sylvestre : I have tried to create an api key with bugzilla-dev ( bugzilla-dev.allizom.org ) But I got " Unauthorized Error"

@globau
Copy link
Contributor

globau commented Oct 26, 2015

@anoopvalluthadam

  1. "unauthenticated testing" means without an api-key. requests such as bug searching/getting will work, but you only have visibility of public bugs.
  2. some other projects that need to run tests against bugzilla run all of their tests within multiple docker containers (this makes CI integration easier too). in this scenario you'd build a docker image for bmo and use that as the end-point for your testing.

@anubnair : did you ask on the #bmo irc channel for access (as per the instructions on every page)?

(edited after reading more)

i don't think this issue should be fixed -- tests should require config.json in order to run.

anoopvalluthadam added a commit to anoopvalluthadam/bztools that referenced this issue Oct 26, 2015
sylvestre added a commit that referenced this issue Oct 26, 2015
issue #31: test running without API key and test cases for query_creator
@sylvestre
Copy link
Contributor Author

I think that anoopvalluthadam@caf54aa implemented the change and I am happy with it.

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

4 participants