FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Convert to Monorepo by Turbo87 · Pull Request #289 · ember-cli-code-coverage/ember-cli-code-coverage · GitHub

Convert to Monorepo - #289

Merged
rwjblue merged 6 commits into
ember-cli-code-coverage:masterfrom
Turbo87:monorepo
Sep 21, 2020
Merged

Convert to Monorepo#289
rwjblue merged 6 commits into
ember-cli-code-coverage:masterfrom
Turbo87:monorepo

Conversation

Turbo87 commented Sep 17, 2020

Copy link
Copy Markdown
Collaborator

😱 😱 😱 😱

no, wait, hear me out!

This PR is inspired by the repository layout that https://github.com/embroider-build/embroider/ is using. Instead of using the barely maintained https://github.com/tomdale/ember-cli-addon-tests project, we instead use a monorepo layout with several fixture packages in a test-packages folder.

This enables us to use these test fixtures for debugging in a much easier way than before because they can also be used outside of running the test suite. In other words you can cd into the folder, run COVERAGE=true ember test there and manually verify the results in the coverage folder.

It also removes the need for running npm install during the test suite because the initial yarn install would have already installed all the necessary dependencies. Locally this seems to significantly speed up the test runs, for some reason they still seem to take roughly the same time on CI though.

rwjblue commented Sep 17, 2020

Copy link
Copy Markdown
Collaborator

This PR is inspired by the repository layout that embroider-build/embroider is using. Instead of using the barely maintained tomdale/ember-cli-addon-tests project, we instead use a monorepo layout with several fixture packages in a test-packages folder.

FWIW, ember-cli-fastboot did the same general move recently (as did ember-engines).

rwjblue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Some files should be moved back to the project root:

  • CHANGELOG.md
  • CONTRIBUTING.md
  • RELEASE.md

Should add a top level version of these files:

  • README.md (either duplicating or referencing the main packages/ember-cli-code-coverage/README.md)

Comment thread package.json
Comment on lines +86 to +95
"changelog": {
"repo": "kategengler/ember-cli-code-coverage",
"labels": {
"breaking": ":boom: Breaking Change",
"enhancement": ":rocket: Enhancement",
"bug": ":bug: Bug Fix",
"documentation": ":memo: Documentation",
"internal": ":house: Internal"
}
},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be moved to root

Comment on lines +103 to +120
"release-it": {
"plugins": {
"release-it-lerna-changelog": {
"infile": "CHANGELOG.md",
"launchEditor": true
}
},
"git": {
"tagName": "v${version}"
},
"github": {
"release": true,
"tokenRef": "GITHUB_AUTH"
},
"npm": {
"publish": false
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be removed (in favor of the changes in ember-fastboot/ember-cli-fastboot#783).

@@ -0,0 +1,67 @@
'use strict';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I find it somewhat odd to have this file "loose" in the same directory as other packages.

Comment on lines +23 to +24
await execa('git', ['clean', '-f', 'my-app-with-in-repo-addon'], { cwd: __dirname });
await execa('git', ['restore', 'my-app-with-in-repo-addon'], { cwd: __dirname });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Seems vaguely odd to do git operations in tests, can you explain what this is cleaning up for?

Comment on lines +21 to +31
beforeEach(async function () {
await rimraf(`${BASE_PATH}/coverage*`);
await execa('git', ['clean', '-f', 'my-app'], { cwd: __dirname });
await execa('git', ['restore', 'my-app'], { cwd: __dirname });
});

afterEach(async function () {
await rimraf(`${BASE_PATH}/coverage*`);
await execa('git', ['clean', '-f', 'my-app'], { cwd: __dirname });
await execa('git', ['restore', 'my-app'], { cwd: __dirname });
});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This prelude seems to be repeated a bunch of times, can we make it a util and replace this in each file with:

setupTest(BASE_PATH);

"browser-test": "COVERAGE=true ember test",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"test": "npm run-script lint:js && npm run-script node-test"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This tries to run node-test, but that's gone

Copy link
Copy Markdown
Collaborator

👍 Very much in favor of this layout, thanks for doing this!

rwjblue commented Sep 21, 2020

Copy link
Copy Markdown
Collaborator

Updated to address the various review comments above.

Turbo87 commented Sep 21, 2020

Copy link
Copy Markdown
Collaborator Author

sorry, had it on the todo list, just didn't have time yet 😩

rwjblue merged commit 7979f03 into ember-cli-code-coverage:master Sep 21, 2020

rwjblue commented Sep 21, 2020

Copy link
Copy Markdown
Collaborator

sorry, had it on the todo list, just didn't have time yet 😩

No worries! I was just helpin' out 😸

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL