Skip to content

[Bug]: Setup testing database environment breaks the immutable infrastructure rule #1844

Closed
@DevDengChao

Description

@DevDengChao

Link to the documentation page or resource

https://docs.strapi.io/dev-docs/testing#set-up-a-testing-environment

Describe the bug

image

The document recommends developers to use a temp local file to host a SQLite database for unit testing, this behavior breaks the immutable infrastructure rule: the developer is using a different database instance from he/she used in production.

This action rises the risk of passing unit test but server down in production.
The risk may comes from different databse type (SQLite vs MySQL), different database version or even hardwares.

Additional context

Suggested improvements or fixes

Deprecate the temp local SQLite database guide for unit testing, and introduce some rollback/truncate guides like https://forum.strapi.io/t/testing-with-a-postgres-database/2232/3?u=devdengchao .

Related issue(s)/PR(s)

Metadata

Metadata

Assignees

Labels

issue: docs/instructionsIssues about incorrect instructions found on docs.strapi.io

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions