From f50e06742994859fc148c22c2110c42ca8d094c7 Mon Sep 17 00:00:00 2001 From: "Quinn C. Hoyer" Date: Thu, 6 Sep 2018 12:37:19 -0800 Subject: [PATCH 1/3] RFC to collocate tests in in-repo-addons --- text/0000-collocate-in-repo-addon-tests.md | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 text/0000-collocate-in-repo-addon-tests.md diff --git a/text/0000-collocate-in-repo-addon-tests.md b/text/0000-collocate-in-repo-addon-tests.md new file mode 100644 index 0000000000..1acb77f150 --- /dev/null +++ b/text/0000-collocate-in-repo-addon-tests.md @@ -0,0 +1,46 @@ +- Start Date: 2018-09-05 +- RFC PR: (leave this empty) +- Ember Issue: (leave this empty) + +# Collocate in-repo-addon tests + +## Summary + +Locate tests that are associated with an in-repo-addon in that addon's tests folder + +## Motivation + +Tests that are collocated next to their code in addons will be more discoverable and maintainable. + +Having a simple syntax for executing tests associated with an addon is useful and time-saving. + +## Detailed design + +- Indicate that an addon has tests that are collocated + - use `includeTestsInHost: true` in `index.js` to indicate collocated tests +- Implement CLI flag that only runs the tests for a specified addon + - `ember test --ir-addon foo-bar` + - The flag's use would create a list of tests to run that are collocated in that in-repo-addon's test folder. The tests will still be included all in one bundle, so this is basically just running the modules that are associated with the co-located tests. + +## Not covered in this RFC +- Splitting the test bundles + - Tests should be separately bundled to allow running these tests without loading other tests. + - In very large application with many in-repo-addons, there is significant overhead in loading all of the application's tests, when only a single in-repo-addon's tests are being tested + - Expect another RFC coming soon to address this functionality + +## How we teach this + +- Create a guide chapter on in-repo-addons + - Add information about this feature to that chapter + +## Drawbacks + +As the use of this feature would be completely optional by a user any drawbacks could be mitigated by not opting in. + +## Alternatives + +- Use isDevelopingAddon to signal test inclusion + +## Unresolved questions + +- Option to run addon tests with dummy app From 28655f3126be008b95bfca146089f8c8f1c7ac00 Mon Sep 17 00:00:00 2001 From: Quinn Hoyer Date: Thu, 20 Sep 2018 07:11:16 -0800 Subject: [PATCH 2/3] Update 0000-collocate-in-repo-addon-tests.md Add point about test dist output remaining the same. --- text/0000-collocate-in-repo-addon-tests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0000-collocate-in-repo-addon-tests.md b/text/0000-collocate-in-repo-addon-tests.md index 1acb77f150..5bce1d4d2d 100644 --- a/text/0000-collocate-in-repo-addon-tests.md +++ b/text/0000-collocate-in-repo-addon-tests.md @@ -6,7 +6,7 @@ ## Summary -Locate tests that are associated with an in-repo-addon in that addon's tests folder +Locate tests that are associated with an in-repo-addon in that addon's tests folder. However, for this RFC, the output of the tests bundles will remain identical to the current output. ## Motivation From a481e824fd7c71471cff36d9c667e9529b81feaa Mon Sep 17 00:00:00 2001 From: Quinn Hoyer Date: Thu, 20 Sep 2018 07:24:22 -0800 Subject: [PATCH 3/3] Update 0000-collocate-in-repo-addon-tests.md --- text/0000-collocate-in-repo-addon-tests.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/text/0000-collocate-in-repo-addon-tests.md b/text/0000-collocate-in-repo-addon-tests.md index 5bce1d4d2d..7dac57f784 100644 --- a/text/0000-collocate-in-repo-addon-tests.md +++ b/text/0000-collocate-in-repo-addon-tests.md @@ -22,12 +22,14 @@ Having a simple syntax for executing tests associated with an addon is useful an - `ember test --ir-addon foo-bar` - The flag's use would create a list of tests to run that are collocated in that in-repo-addon's test folder. The tests will still be included all in one bundle, so this is basically just running the modules that are associated with the co-located tests. -## Not covered in this RFC +## Not covered in this RFC (but will be covered in a following RFC) - Splitting the test bundles - Tests should be separately bundled to allow running these tests without loading other tests. - In very large application with many in-repo-addons, there is significant overhead in loading all of the application's tests, when only a single in-repo-addon's tests are being tested - Expect another RFC coming soon to address this functionality - +- Option to run addpn tests with dummy app + - Tests for an in-repo-addon/engine could be chosen to either run against the main app, or a (shared) dummy app. + ## How we teach this - Create a guide chapter on in-repo-addons @@ -43,4 +45,4 @@ As the use of this feature would be completely optional by a user any drawbacks ## Unresolved questions -- Option to run addon tests with dummy app +