Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

feat(config): Add 'random' and 'seed' Jasmine config options #3467

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

szimek
Copy link
Contributor

@szimek szimek commented Aug 11, 2016

Feature Request

This adds handling of random and seed options in jasmineNodeOpts and allows to run specs in random order. The descriptions for both options are taken from Jasmine docs.

  • Reasons for adopting new feature
    Running specs in random order is usually preferable, as it ensures that the tests don't depend on each other and don't leak unwanted changes.
  • Is this a breaking change? (How will this affect existing functionality)
    Nope.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@szimek
Copy link
Contributor Author

szimek commented Aug 11, 2016

I signed it!

On 11 August 2016 at 15:11, googlebot [email protected] wrote:

Thanks for your pull request. It looks like this may be your first
contribution to a Google open source project. Before we can look at your
pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/
https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll

verify. Thanks.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#3467 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAAmka2EVqD8Von-QyZOg0AXxKrbXddLks5qex9tgaJpZM4JiGpM
.

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

@szimek
Copy link
Contributor Author

szimek commented Aug 12, 2016

The one thing that I'm not sure of is how to show a custom text once all specs are finished. In jasmine-npm console reporter they show what seed was used to randomize specs, which may be useful if your tests fail and you want to restart them in the exact same order, thus using the same seed.

@sjelin
Copy link
Contributor

sjelin commented Aug 12, 2016

Good idea! Why not throw it on to err.message on 120 of lib/frameworks/jasmine.js?

@sjelin sjelin self-assigned this Aug 12, 2016
@szimek
Copy link
Contributor Author

szimek commented Aug 13, 2016

Turns out that Protractor doesn't have to handle printing of the seed used, as Jasmine reporters should take care of this. I'm using a custom reporter (SpecReporter) instead of the default one, which doesn't seem to print it out, but when I switched back to the default one, I got:

Ran 3 of 7 specs
3 specs, 1 failure
Finished in 9.273 seconds
Randomized with seed 91703
[15:34:59] I/launcher - 0 instance(s) of WebDriver still running
[15:34:59] I/launcher - chrome #01 failed 1 test(s)
[15:34:59] I/launcher - overall: 1 failed spec(s)
[15:34:59] E/launcher - Process exited with error code 1

so it looks like everything is ok.

@szimek
Copy link
Contributor Author

szimek commented Aug 20, 2016

@sjelin My PR to jasmine-spec-reporter to show the seed used has been merged recently and now I'm getting the following output with the latest jasmine-spec-reporter and protractor that includes this PR:

Executed 184 of 184 specs SUCCESS in 8 mins 41 secs.
Randomized with seed 22937.
[20:36:48] I/launcher - 0 instance(s) of WebDriver still running
[20:36:48] I/launcher - chrome #01 passed

so I think that this PR can be merged as it is.

@cnishina
Copy link
Contributor

cnishina commented Nov 7, 2016

Please rebase.

@szimek szimek force-pushed the add-jasmine-random-option branch from 1424150 to d1f6d9b Compare November 7, 2016 18:49
@cnishina cnishina merged commit 6ebee72 into angular:master Nov 7, 2016
@szimek szimek deleted the add-jasmine-random-option branch November 7, 2016 19:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants