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

Add rush test command #60

Merged
merged 6 commits into from
Jul 1, 2019
Merged

Add rush test command #60

merged 6 commits into from
Jul 1, 2019

Conversation

vogre
Copy link
Contributor

@vogre vogre commented Jul 1, 2019

Changes to #51 - replace bash with a rush command.

Vladimir Zoubritsky added 5 commits July 1, 2019 12:06
Changed since introduction of typescript tests which create the
directory before.
Avoid warnings about output in stderr
@vogre vogre requested a review from arikmaor July 1, 2019 09:14
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Thanks!

echo Testing $project
(cd $project && npm test) || exit 1
done
command: node common/scripts/install-run-rush.js test --verbose
Copy link
Contributor

Choose a reason for hiding this comment

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

This is much nicer. Might even work with Windows!

@@ -7,7 +7,7 @@
],
"description": "",
"scripts": {
"build": "rm -rf dist && tsc && cp -r src/test/backend/ dist/test/",
"build": "rm -rf dist && tsc && cp -r src/test/backend dist/test/",
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't modern tscs clean up enough to do this nicely and quickly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tsc does not clean up, so various confusing files collect up over time.

Copy link
Contributor

Choose a reason for hiding this comment

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

But the behaviour this implements is confusing Seems like we're trying to fix microsoft/TypeScript#30602 en passant. It will confuse various tools (such as anything that looks at file mtimes. It discourages tsc -w.

I don't want to second-guess TypeScript.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not an uncommon pattern (e.g. https://github.com/ReactiveX/rxjs-tslint/blob/11d64176b717c5029c212d883bfc2dfc5d14d06d/package.json#L14), I just copied it from somewhere - this is just the most paranoid version of starting from a clean slate. I run tsc -w without cleaning directory during development but I agree it's not the best solution.

{
"changes": [
{
"comment": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor

Choose a reason for hiding this comment

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

Standard rush stuff...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A dummy rush change since this isn't really a patch change which requires a release and only the testing infrastructure.

"commandKind": "bulk",
"name": "test",
"summary": "Run all tests",
"enableParallelism": false
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not? (It would be disappointing if Rush is incapable of re-ordering the output to get this to print errors nicely.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is disappointing, really. I documented this and other reasons why it's serial now.

"commandKind": "bulk",
"name": "test",
"summary": "Run all tests",
"enableParallelism": false
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be true?

@@ -7,7 +7,7 @@
],
"description": "",
"scripts": {
"build": "rm -rf dist && tsc && cp -r src/test/backend/ dist/test/",
"build": "rm -rf dist && tsc && cp -r src/test/backend dist/test/",
Copy link
Contributor

Choose a reason for hiding this comment

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

why did you make this change? it can cause a dist/test/backend/backend to be created

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was a bug - the tests did not pass on mac before. See this example - for a cross-platform copying of a directory contents need to cp -a source/. destination, or in this example cp -r src/test/backend/. dist/test/backend - this only writes backend once by omitting the trailing slash which causes the Mac OS behavior.

Copy link
Contributor

@arikmaor arikmaor left a comment

Choose a reason for hiding this comment

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

Thanks :)

Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Approving since I'm really arguing against the already-existing (mis?) feature during builds. This argument doesn't belong on a PR that fixes the feature, it's better fixed than it is broken.

@@ -7,7 +7,7 @@
],
"description": "",
"scripts": {
"build": "rm -rf dist && tsc && cp -r src/test/backend/ dist/test/",
"build": "rm -rf dist && tsc && cp -r src/test/backend dist/test/",
Copy link
Contributor

Choose a reason for hiding this comment

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

But the behaviour this implements is confusing Seems like we're trying to fix microsoft/TypeScript#30602 en passant. It will confuse various tools (such as anything that looks at file mtimes. It discourages tsc -w.

I don't want to second-guess TypeScript.

@vogre vogre merged commit 1b0f0ef into master Jul 1, 2019
@vogre vogre deleted the test-command branch July 1, 2019 14:20
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.

3 participants