-
Notifications
You must be signed in to change notification settings - Fork 311
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
Write a test to make sure a new DB is downloaded when an already downloaded DB exists with an old schema #1108
Comments
It's possible that this is already kind of supported, as we check the ETag and the ETag changes when the schema version changes. We need to add a test to confirm. |
For this, would we want to update and download a newer version or just exit the function with false like |
We should try to download a new version. |
Hi,
what to do if it is an old schema? |
Can i take this work? |
No, the issue is still here. If you look at the code, you'll see that
Please read all the comments, it is explained above. |
You can work on any issue which is open and has no PR linked to it. |
Hello @marco-c , I am thinking to implement a new function download_check_version() similar to download_check_etag() in the bugbug/utils.py which will be called after downloading the current DB. Then return false if that is the case. Am I going to the right direction? Avijit |
@avijit1258 the goal is to remove a DB when its schema version is old compared to the current schema. I'm not sure how what you proposed is going to do this, but I'm not sure exactly what you mean. Proposing a PR is the best way to show what you mean ;) |
@marco-c How can I reproduce the situation you are telling? Can you give any url to try or way to figure out this? I have installed the repo and trying to figure things out. This is my first time trying to contribute to such a real project. |
@avijit1258 the first step is to look at the code I linked at in the first comment, and take a look at all the functions it calls and figure out how it works. |
I have three questions.
Here current means new or latest? or existing?
Thanks |
No, the purpose is to avoid using an already downloaded DB if its schema is not the current schema. The schema of the downloaded DB can be read from the ".version" file, its current schema can be read from the DATABASES dict. |
@marco-c Thanks for the clarification. Things are becoming more clear now. By saying test, do you mean checking it in the download function or writing a test case for download function in test file? |
The second: writing a test case. |
Can I just simply assert that new db is not downloaded |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
But isn't line 91 already check if its old schema and therefore if it is then returning false |
@tarunjarvis5 yes, the code is doing that, but this issue is about adding a test to ensure it works correctly. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Hello, I am an outreachy applicant. Can I work on it? |
Yes, please read CONTRIBUTING.md and #1092 for the contributing rules. |
I'm interested in this, please confirm if its fine to add a new file for this test. Thanks |
As stated in CONTRIBUTING.md, you can work on any issue without asking, as long as there is no open PR linked to it. |
Hey @marco-c, Do I need to write assert statements for testing this function? |
Yes, please read the comments above. |
Workng on Bug ID id 1108 I also want to discover how to run the test (I have already installed -test-requirements.txt |
The
Yes, you could run all tests using |
@fadebowaley are you still working on this? |
@suhaibmujahid To make sure a new DB is downloaded, I have assertion error while attempting to download the database
............ |
As stated in CONTRIBUTING.md, you can work on any issue without asking, as long as there is no open PR linked to it. |
In the download method,
bugbug/bugbug/db.py
Line 89 in d1016a3
The text was updated successfully, but these errors were encountered: