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

Some test do not work if you move the database file #125

Closed
josecelano opened this issue Dec 12, 2022 · 1 comment
Closed

Some test do not work if you move the database file #125

josecelano opened this issue Dec 12, 2022 · 1 comment
Labels
Bug Incorrect Behavior

Comments

@josecelano
Copy link
Member

I'm working on this PR #123. I needed to move the SQLite database from the root folder to a new storage folder, and some tests have been broken.

The problem is the tests are using the default location for the SQLite database, which is the file data.db in the root folder and one test is also creating the database if it does not exist.

We have to fix it. We need to use a different location to isolate tests from the default location for the production database. And we should also use an independent database for each test.

We did it for the newer API tests here. We just need to do the same.

If you remove both the config.toml and the data.db file in the root folder, you'll see how the data.db file is created again.

@josecelano josecelano added the Bug Incorrect Behavior label Dec 12, 2022
josecelano added a commit that referenced this issue Dec 12, 2022
I was using the deafult DB configuration for some tests.

Every test has to use its own database and the database should be
located in a different location than the production default location.
josecelano added a commit that referenced this issue Dec 12, 2022
dca7550 fix: [#125] using default sqlite db for tests (Jose Celano)

Pull request description:

  I was using the default DB configuration for some tests.

  Every test must use its database to decouple tests.

  And the database must be located in a different location than the production default location to avoid overwriting production data accidentally.

Top commit has no ACKs.

Tree-SHA512: 8f1403302fb737a446e2a04d41d24079fe0713ea57202a9a0f83644a628fb425754e431a445df44de09f7faabccdf86f4560270c4e903573a1168ecdd82f2ab7
@josecelano
Copy link
Member Author

Fixed with 8982159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Incorrect Behavior
Projects
Archived in project
Development

No branches or pull requests

1 participant