From adecbf6ce923f2d1f2aec8e4b3bcfd2cd57a68c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Andrieu?= Date: Tue, 22 Jan 2019 10:17:04 +0100 Subject: [PATCH 1/2] Added a section for testing when they migrate a page --- .../architecture/migration-guide/_index.md | 1 + .../architecture/migration-guide/clean-up.md | 1 - .../architecture/migration-guide/testing.md | 46 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 src/content/1.7/development/architecture/migration-guide/testing.md diff --git a/src/content/1.7/development/architecture/migration-guide/_index.md b/src/content/1.7/development/architecture/migration-guide/_index.md index 37dddd6180..4c12e49fc8 100644 --- a/src/content/1.7/development/architecture/migration-guide/_index.md +++ b/src/content/1.7/development/architecture/migration-guide/_index.md @@ -27,6 +27,7 @@ This is the list of items that usually need to be done in order to complete the - Checks permissions and demo mode constraints - Re-introduce hooks (and document the missing one if you can't for a good reason) - Complete `Link` class to map PrestaShop menu to the new page + - Create the smoke/survival tests for the migrated page - Deletions - Remove the old controller in `controllers/admin/Admin*.php` - Remove related old templates (in `admin-dev/themes/default/template/controllers/*`) diff --git a/src/content/1.7/development/architecture/migration-guide/clean-up.md b/src/content/1.7/development/architecture/migration-guide/clean-up.md index 66e2393f0d..41a86f42c1 100644 --- a/src/content/1.7/development/architecture/migration-guide/clean-up.md +++ b/src/content/1.7/development/architecture/migration-guide/clean-up.md @@ -10,4 +10,3 @@ Once everything is migrated, refactored, extracted to specific classes and worki * Delete the old controller. * Delete the old templates (delete the `admin-dev/themes/default/template/controller/{name}` folder. * Delete the related "legacy tests". - diff --git a/src/content/1.7/development/architecture/migration-guide/testing.md b/src/content/1.7/development/architecture/migration-guide/testing.md new file mode 100644 index 0000000000..3c342759a9 --- /dev/null +++ b/src/content/1.7/development/architecture/migration-guide/testing.md @@ -0,0 +1,46 @@ +--- +title: Testing +weight: 70 +--- + +# Testing + +You are encouraged to add both unit and functional tests for every new class +you have created. + +You are required to add a smoke test (also called "survival") for every new page +you migrate. + +## Smoke testing + +A smoke test is a really simple and basic test that ensure the page will load with +the right HTTP code. This won't ensure the page will works as expected **but** if the test fails, this ensure the page is not functional. + +To add a new test, you need to add a new entry in the Data Provider of SurvivalTest class: + +```php + ['Page title', 'symfony_route_of_page'], + // ... + ]; + } +} +``` From 40b0e0c308d23ec21469958c7effb55ce27f0bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Andrieu?= Date: Tue, 29 Jan 2019 10:20:47 +0100 Subject: [PATCH 2/2] Address @PierreRambaud comments --- .../development/architecture/migration-guide/testing.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/content/1.7/development/architecture/migration-guide/testing.md b/src/content/1.7/development/architecture/migration-guide/testing.md index 3c342759a9..6f4e7582d1 100644 --- a/src/content/1.7/development/architecture/migration-guide/testing.md +++ b/src/content/1.7/development/architecture/migration-guide/testing.md @@ -8,7 +8,7 @@ weight: 70 You are encouraged to add both unit and functional tests for every new class you have created. -You are required to add a smoke test (also called "survival") for every new page +You **must** add a smoke test (also called "survival") for every new page you migrate. ## Smoke testing @@ -22,10 +22,7 @@ To add a new test, you need to add a new entry in the Data Provider of SurvivalT