-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.tests
23 lines (16 loc) · 1013 Bytes
/
README.tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
bdcs-api testing
================
The depsolve part of the ServerSpec.hs test requires a metadata.db with packages. We ship a
test database in ./tests/mddb/metadata.db along with the fake rpms used to create it.
From time to time the test metadata.db may need to be regenerated. This will usually happen
when bdcs has changed the database schema. This is currently a manual process because the
schema.sql file is only shipped with the bdcs source, not installed anywhere.
* rm ./tests/mddb/metadata.db
* sqlite3 ./tests/mddb/metadata.db < /PATH/TO/schema.sql
* for f in ./tests/mddb/*rpm; do /PATH/TO/bdcs-import ${PWD}/tests/mddb/metadata.db /tmp/cs.repo file://${f}; done
* rm -rf /tmp/cs.repo
You can then commit the updated metadata.db into git.
The fake rpms used for the tests shouldn't need to be re-generated, but if they are you can do that by
installing rpmfluff (python3-rpmfluff if you are running Fedora) and running:
python3 ./tests/mkTestRPMs.py
And then committing the new rpms to git.