-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Development: update initial fixture #8914
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
Comments
Hi, |
Yes. The idea here is to re-create the (*) by useful, I mean projects with particularities: use conda, use mamba, build fast, build slow, use the config file v2, use |
Hi @humitos ,
Sorry if my questions are redundant, I haven't worked on this before and would like to get everything clarified. |
We use Django fixtures for this. You can read the howto guide about this from https://docs.djangoproject.com/en/3.2/howto/initial-data/
We can start with the projects I mentioned already for now. |
@humitos I added one project in test_data.json readthedocs.org/readthedocs/projects/fixtures/test_data.json Lines 194 to 209 in 44a9d53
For "pk" I added the next biggest sequential number (last was 22). However I'm not sure about "modified_date" and "pub_date" (they have the same value as one of the other projects). What values should be added for these date fields? |
Hi @tanvimoharir! You shouldn't modify this file by hand. You should use the Django management command to export the data from your database once you have imported all the projects required. In the howto guide that I shared, this is explained step by step. |
Thanks for explaining it to me( the how-to guide had mentioned adding fixtures manually which is why I tried that) |
Are any automated tests depending on the exact structure of these fixtures? I'm guessing I'll find out from trying to remove them now :) |
@benjaoming no, there are not. These JSON are created automatically by Django management command. However, I proposed a different and simpler approach to follow with regular Python code instead of the usage of these fixtures. That's probably a better solution to this. See #9319 (comment) |
We do have tests that load the fixtures
|
Thanks! I'll go through this test to ensure it's not affected by the updates of the fixtures. Good idea @humitos to have separate fixtures for tests vs. "demo". Test fixtures are nice to maintain close to the tests or inside the tests. Will open an issue 👍 |
Uh oh!
There was an error while loading. Please reload this page.
We are loading
test_data.json
from https://github.com/readthedocs/readthedocs.org/blob/40bc5b1c01a8edfcaf4b898e5b79565598e36d51/readthedocs/projects/fixtures/test_data.json when runninginv docker.up --init
at https://github.com/readthedocs/common/blob/0620e5dad7831c8c6d093efb7e5c91d8118d9c61/dockerfiles/entrypoints/web.sh#L11That fixture contains some projects that are old or are abandoned and are not good test cases to have under the development environment. It would be good to update them with better projects for testing. Those project includes
test-builds
,docs
,sphinx-notfound-page
,sphinx-hoverxref
,blog
and some other projects maintained by the community, likepoliastro
,geopandas
,godot
,numpy
,xarray
,sphinx
, etc.The text was updated successfully, but these errors were encountered: