-
Notifications
You must be signed in to change notification settings - Fork 3
How to create testdata
Copied from devonogear/devonogear wiki and PR [devonogear/devonogear#113] (https://github.com/denovogear/denovogear/pull/113)
[devonogear/devonogear#113] (https://github.com/denovogear/denovogear/pull/113)
SHA256 is considered more secure that MD5, so it is a good idea to use it to validate our testdata.tar.gz download.
At the same time, create a make_testdata_sum target to simplify the calculation of the SHA256, e.g.
- Commit new testing data to the testdata repo.
- Identify the commit id of the updated testdata repo
- Edit the
TESTDATA_COMMITintest/CMakeList.txtto reflect the new id. - Run
make make_testdata_sumto calculate the SHA256 of the data - Paste the result into
TESTDATA_SHA256intest/CmakeList.txt - Run
make testdatato verify that it works.
[Updating Test data] (https://github.com/denovogear/denovogear/wiki/Developer:-Notes#updating-test-data)
If you add or edit files in the test data repository you will need to edit the Tests/CMakeLists.txt file of the denovogear repo to ensure the new data is downloaded when tests are run. Specifically you need to include the sha-1 hash for the commit that includes your changes and an SHA256 checksum for the contents of the repo.
SET(TESTDATA_COMMIT c4ff355)
SET(TESTDATA_SHA256 b8c2f82f6b6662d1826e99722e378b2e6af25499eed553c4ec451633ce45935d)The sha can be found on the repo's github page, or by typing git log on your local machine.
The SHA256 checksum can be generated by editing TESTDATA_COMMIT and calling
make make_testdata_sumSee #113.
The sum can also be generated with a one-liner
wget -q -O - https://api.github.com/repos/denovogear/testdata/tarball/${commit-sha} | sha256sumRun make testdata to verify that it works.