Closed tai271828 closed 2 years ago
Ooops, CI failed for checking the seed of test data set. I will update this pull request to fix the CI. @yanghaochang104 @EagleC0318 @Neilxx @joshuay1 @zztin before I fix the CI, I still appreciate if you can comment on this idea of reducing test data. Do you think it is reasonable?
Maybe not a regression because http://ohshown.site:8080/ still shows the entries.... hmmm let me see what's going on.
Ah, stupid me. I forgot to update my frontend codebase.
Fixed CI! This pull request is ready to review again. Please input your comments. Any of your comments will be appreciated.
@tai271828 A quick question just comes up in my mind. Would the user reported data be gone, if the BE server restart?
Interesting, so when we start the BE server, the backend/fixtures/full-info.csv will be loaded to DB?
Yes, via drango migration.
The fake factory data is not useful for us, so I think it's good to remove them. Looks good for me!
It's useful if we (well, I : ) ) want to refactor the original disfactory codebase. Besides, some unittest still use it so we should not remove the data unless we want to deprecate the corresponding test cases as well.
The mock-up data is also useful if we slightly modify it to be mock-up data for wild-animal reports.
@tai271828 A quick question just comes up in my mind. Would the user reported data be gone, if the BE server restart?
The data are stored in the docker volume
by default. See https://github.com/tai271828/disfactory-backend/blob/main-tbbca/backend/docker-compose.dev.yml#L34
So any manipulation destorying/removing the volume will remove the data. For example:
/tmp/db_dump/
in our case manually or restarting your laptop.Land for main-tbbca
to main
migration.
By reducing the pool of the test data set, it will help us focus on the regression of refactoring[1].
Steps to Verify This Pull Request
NOTE!! This command will remove the data in your development database. Do not invoke the command until you know what you are going to do:
docker-compose -f docker-compose.dev.yml down; sudo rm -rf /tmp/disfactory_d*; docker-compose -f docker-compose.dev.yml up -d --build --force-recreate
Expected Result
The dataset of testing is much smaller. (less than 10 entries)
Additional Context
If the pool is small enough, it is easy for us to catch the regression
like this (frontend missing to show the entries in the database)~~The entries are in 台南 and should show up. I think this is because the regression of https://github.com/tai271828/disfactory-backend/pull/46 and https://github.com/tai271828/disfactory-frontend/pull/63 ~~