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

Academies database connection - create fake data generator #172

Conversation

lookupdaily
Copy link
Contributor

@lookupdaily lookupdaily commented Oct 12, 2023

This change adds a new console application which will be used to generate fake data against the Academies Database schema, for use in playwright tests.

This project uses the Fake Data Generator developed for the TRAMS-alpha prototype as a basis, and have taken the relevant example data and helpers from here.

This is related to User Story 134572: Build: Connect to Academies DB

Changes

  • Add Faker project: We have placed this inside our tests folder as its primary function will be to generate data to use in tests. We may also use this project for seeding data in the local development environment, but we wanted to clearly separate it from production code
  • Create GroupFaker class based on the Group table model from the DfE.FindAcademiesTrusts.AcademiesDb project
  • Generate data for the fields we are currently using in the application, using data from the database as a guide. For example, all Trust names are capitalised in the database and some address properties have the value "Not recorded
  • Output fake data as a json list until we have built the containerised database seeding mechanism

Screenshots of UI changes

N/A

Checklist

  • Deploy this branch to the test environment for manual testing once comments have been resolved and checks have passed
  • Attach this pull request to the appropriate user story in Azure DevOps
  • Update the ADR decision log if needed

@lookupdaily lookupdaily temporarily deployed to development October 12, 2023 10:33 — with GitHub Actions Inactive
@lookupdaily lookupdaily temporarily deployed to development October 12, 2023 10:36 — with GitHub Actions Inactive
.dockerignore Outdated Show resolved Hide resolved
Create new console application `DfE.FindInformationAcademiesTrusts` which we will use to generate seed data for our tests.

We have placed this inside our tests folder as its primary function will be to generate data to use in tests. We may also use this project for seeding data in the local development environment, but we wanted to clearly separate it from production code.
Create `GroupFaker` class based on the Group table model from the `DfE.FindAcademiesTrusts.AcademiesDb` project.

This Faker only generates data for the fields we are currently using in the application.

Emitting the result of the generated data to a json file for now.

This project uses the Fake Data Generator developed for the TRAMS-alpha prototype as a basis, and have taken the relevant example data and helpers from here.

https://github.com/dynamictulip/FakeDataGenerator
All trusts in the database are stored in uppercase, so this will make our data more realistic.
Use the same naming pattern as the `DfE.FindInformationAcademiesTrusts.Data.AcademiesDb` to make it clear that the Faker is a replacement for this data project in tests.
Some fields in the Academies db contain the value "Not recorded" rather than an empty string or NULL. Adding this as a random value in our address properties to replicate this.
@lookupdaily lookupdaily force-pushed the academies-db-connection/fake-data-generator branch from cd17cc5 to d3b8193 Compare October 12, 2023 10:50
@lookupdaily lookupdaily temporarily deployed to development October 12, 2023 10:50 — with GitHub Actions Inactive
@lookupdaily lookupdaily temporarily deployed to development October 12, 2023 10:53 — with GitHub Actions Inactive
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@lookupdaily lookupdaily merged commit a894104 into academies-db-connection-feature Oct 12, 2023
@lookupdaily lookupdaily deleted the academies-db-connection/fake-data-generator branch October 12, 2023 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants