Repository navigation
8670: Rewrite the fixtures to cover all content - #168
Merged
Merged
Conversation
The site filter test now removes the fixture sites it does not set up, the link command test counts from what the fixtures already link, the module sort test checks the order of the counts, and the linker test checks the module is not linked by name rather than not linked at all.
Made-up data shaped like production: a repo checked out at two versions with overlapping advisories, a repo without advisories, a release deployment without a repo, drupal.org and Packagist advisories with and without a CVE, one CVE under two advisory ids, and Drupal modules linked to their Composer packages. A test pins these cases and that only example data is used.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #168 +/- ##
=============================================
+ Coverage 66.70% 75.74% +9.03%
- Complexity 1295 1300 +5
=============================================
Files 168 168
Lines 3998 3987 -11
=============================================
+ Hits 2667 3020 +353
+ Misses 1331 967 -364
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
One file per area: servers, sites with the detection results behind them, git repos, packages and advisories, Docker images, projects with code owners and security contracts, OIDC and service certificates. Every entity, detection type, server type and site type is represented, with made-up values shaped like production. FixturesTest pins the scenarios, that replaying the detection results rebuilds the same installations and sites, that each server's dir result lists all its installations, and that only example data is used. Tests tied to the old fixtures now use the shop sites, the never-harvested gpu-01 server or counts relative to the fixtures.
3 of 4 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to ticket
https://leantime.itkdev.dk/#/tickets/showTicket/8670
Description
Rewrite the fixtures so they cover all content with realistic, made-up data. This gives the "not affected" feature in 8670, and every admin page, data to work against.
Changes:
server.yaml: one server of each type (prod, stg, devops, gpu), on Hetzner and in the DMZ. gpu-01 has never been harvested.site.yaml: detection results of every type (dir, docker, nginx, git, drupal, symfony), with the installations, sites and domains built from them. Each result's data is defined as a YAML parameter and stored as JSON, as the harvester sends it.git.yaml: repos and tags. One repo is checked out on stg at a branch and on prod at a tag.package.yaml: packages, versions, advisories and Drupal modules (previouslyadvisory.yaml).docker.yaml: images and tags, including an official image and one from ghcr.io.project.yaml: projects with code owners, git repos and security contracts, now with fixtures for all three.oidc.yamlandservice_certificates.yaml: point at the new sites.tests/DataFixtures/FixturesTest.phpchecks:SiteFilterTestnow uses the shop sites;DirectoryHandlerTestuses the never-harvested gpu-01;PaginationTesttops up from the current server count;Why: the old fixtures had ten random Faker servers and two nginx sites without the detection results behind them. They had no packages, advisories, git repos, Docker images or projects. The shapes follow the production database; the values are all made up.
Checklist