[go: nahoru, domu]

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

move emulator suite tests into scripts folder #3035

Merged
merged 13 commits into from
Jan 15, 2021
Merged

Conversation

bkendall
Copy link
Contributor
@bkendall bkendall commented Jan 14, 2021

Description

These tests aren't really "unit" tests as much as they are "integration" or "functional" tests. They take ~500ms each to run, so taking them out of our "unit" test path would speed them up greatly (down to 9s, in fact).

This does a little bit of fancy footwork. The process for these particular tests is this:

  • build the scripts and src directories into a dev directory
  • run the tests in dev/scripts using mocha
  • clean up dev

It's a little odd, but it allows the fact that it spawns child processes using node and the generated code, making it a bit easier.

The reason I don't want to do this with all the unit tests (even though these tests still take ~10s, which doubles the unit tests runtime) is that I lose the source mappings and coverage information. For some reason, these tests fail in strange ways when I generate the source maps alongside the code (which is why they're disabled).

@google-cla google-cla bot added the cla: yes Manual indication that this has passed CLA. label Jan 14, 2021
@bkendall bkendall marked this pull request as ready for review January 14, 2021 19:21
@coveralls
Copy link
coveralls commented Jan 14, 2021

Coverage Status

Coverage decreased (-3.2%) to 62.33% when pulling e8c1d1c on bk-emulator-suite into cea069c on master.

@bkendall
Copy link
Contributor Author

Yes, the coverage went down, but there's not much I can do about that at the moment. New, more unity tests would have to be written for some of the emulator parts.


# Run the tests from the built dev directory.
mocha \
--bail \
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally we don't use --bail (although I don't mind), did you intend to do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

dev/scripts/emulator-tests/*.spec.*

# Remove the built artifacts.
rm -rf dev
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this run if mocha fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced it with a trap so it will always be run on exit :)

@bkendall bkendall merged commit daa9fd5 into master Jan 15, 2021
@bkendall bkendall deleted the bk-emulator-suite branch January 15, 2021 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Manual indication that this has passed CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants