Skip to content

Check db during integration test #48

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

Merged
merged 3 commits into from
Jun 8, 2021
Merged

Check db during integration test #48

merged 3 commits into from
Jun 8, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Jun 8, 2021

db.json provides storage of the library index data in the Library Manager back end. The library_index.json content for
previously indexed library releases is generated from this data with only the data for new releases being generated from
the library repository content. For this reason, it's very important for the db.json content to be correct.

Checking the db.json generated from a run of the system against a "golden master" provides improved confidence that the
content remains correct during development on the project.

The "golden master" db.json was checked against the one generated by the final "production" engine version
(60ebae3ec0715c211682820354ebb0dfc3de2436) of the old library Manager system, confirming the only changes were:

  • The expected checksum changes.
  • The since added "Log" field.

…ion test

The checksums are different every time the index is generated, so they must be removed before comparing the index against
the golden master. Previously, the approach was to delete the entire checksum key from the index data. I think a better
approach is to replace the data with a placeholder because the golden master having a templated value rather than a
missing key is more intuitive for maintainers.
@per1234 per1234 added type: enhancement Proposed improvement topic: infrastructure Related to project infrastructure labels Jun 8, 2021
@per1234 per1234 requested review from silvanocerza and umbynos June 8, 2021 02:28
per1234 added 2 commits June 8, 2021 07:01
Small variation in the archive size could result from compression algorithm changes. With the previous exact comparison
against the size data in the golden master index, this would cause a spurious test failure. The solution is to allow some
tolerance in the sizes during the comparison. This still provides a useful "smoke test" while avoiding the test requiring
undue maintenance effort.
db.json provides storage of the library index data in the Library Manager back end. The library_index.json content for
previously indexed library releases is generated from this data with only the data for new releases being generated from
the library repository content. For this reason, it's very important for the db.json content to be correct.

Checking the db.json generated from a run of the system against a "golden master" provides improved confidence that the
content remains correct during development on the project.

The "golden master" db.json was checked against the one generated by the final "production" engine version
(60ebae3ec0715c211682820354ebb0dfc3de2436) of the old
library Manager system, confirming the only differences were:

- The expected checksum changes.
- The since added "Log" field.
@per1234 per1234 merged commit 464e243 into arduino:main Jun 8, 2021
@per1234 per1234 deleted the test-db branch June 8, 2021 15:40
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants