Skip to content

build: schematics unit tests not being run #22293

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

Merged
merged 1 commit into from
Mar 19, 2021

Conversation

crisbeto
Copy link
Member

Currently the schematics unit tests aren't being run and are assumed as passing. This was a result
of the following issues:

  1. The require.resolve call in the index.spec.ts files was failing, but it was inside of a Promise so it got silenced. It caused the test runner to completely give up on running the tests. I was only able to see the failure using a debugger.
  2. Even if the require.resolve call worked as expected, the filegroup call doesn't seem to actually work, at least on Windows which would prevent the files from showing up in the Bazel directory. I've switched it to copy_to_bin.
  3. There was some issue with loading the index.spec.ts, presumably because the file name follows the same pattern as unit test files. I've renamed it to paths.ts as a workaround.

@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 19, 2021
Currently the schematics unit tests aren't being run and are assumed as passing. This was a result
of the following issues:

1. The `require.resolve` call in the `index.spec.ts` files was failing, but it was inside of a
`Promise` so it got silenced. It caused the test runner to completely give up on running the tests.
I was only able to see the failure using a debugger.
2. Even if the `require.resolve` call worked as expected, the `filegroup` call doesn't seem to
actually work, at least on Windows which would prevent the files from showing up in the Bazel
directory. I've switched it to `copy_to_bin`.
3. There was some issue with loading the `index.spec.ts`, presumably because the file name follows
the same pattern as unit test files. I've renamed it to `paths.ts` as a workaround.
@crisbeto crisbeto force-pushed the schematics-test-fix branch from fa467e3 to 63dcd3c Compare March 19, 2021 15:26
@crisbeto crisbeto marked this pull request as ready for review March 19, 2021 15:39
@crisbeto crisbeto added merge safe P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Mar 19, 2021
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Mar 19, 2021
@andrewseguin andrewseguin merged commit 263c90c into angular:master Mar 19, 2021
andrewseguin pushed a commit that referenced this pull request Mar 19, 2021
Currently the schematics unit tests aren't being run and are assumed as passing. This was a result
of the following issues:

1. The `require.resolve` call in the `index.spec.ts` files was failing, but it was inside of a
`Promise` so it got silenced. It caused the test runner to completely give up on running the tests.
I was only able to see the failure using a debugger.
2. Even if the `require.resolve` call worked as expected, the `filegroup` call doesn't seem to
actually work, at least on Windows which would prevent the files from showing up in the Bazel
directory. I've switched it to `copy_to_bin`.
3. There was some issue with loading the `index.spec.ts`, presumably because the file name follows
the same pattern as unit test files. I've renamed it to `paths.ts` as a workaround.

(cherry picked from commit 263c90c)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants