Skip to content

build: upgrade jasmine (and related typings) to latest version - #19904

Closed
gkalpak wants to merge 9 commits into
angular:masterfrom
gkalpak:build-upgrade-jasmine
Closed

gkalpak wants to merge 9 commits into
angular:masterfrom
gkalpak:build-upgrade-jasmine

Conversation

@gkalpak

@gkalpak gkalpak commented Oct 24, 2017 •

Copy link
Copy Markdown
Member

PR Checklist

PR Type

[x] Build related changes

What is the current behavior?

Older version of jasmine/jasmine-node and corresponding typings.

What is the new behavior?

Latest version of jasmine/jasmine-node and corresponding typings.

Does this PR introduce a breaking change?

[ ] Yes
[x] No(t intentionally :grin:)

Other information

With these changes, the types are a little stricter now and also not compatible with Protractor's jasmine-like syntax. So, we have to also use @types/jasminewd2 for e2e tests (but not for non-e2e tests).

I also had to "augment" @types/jasminewd2, because the latest typings from DefinitelyTyped do not reflect the fact that the jasminewd2 version currently used by Protractor (v2.1.0) supports passing a done callback to a spec.

@gkalpak gkalpak added area: build & ci Related the build and CI infrastructure of the project action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release PR target: TBD and removed target: patch This PR is targeted for the next patch release labels Oct 24, 2017
@mary-poppins

Copy link
Copy Markdown

You can preview 3e2ed3c at https://pr19904-3e2ed3c.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 3e2ed3c to bc82db9 Compare October 24, 2017 17:34
Comment thread tools/types-ext/jasminewd2.d.ts Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Come on clang-format! 😞

Comment thread tools/types-ext/jasminewd2.d.ts Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

😞 😞 😞

@mary-poppins

Copy link
Copy Markdown

You can preview bc82db9 at https://pr19904-bc82db9.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from bc82db9 to c0746ed Compare October 24, 2017 18:13
@mary-poppins

Copy link
Copy Markdown

You can preview c0746ed at https://pr19904-c0746ed.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from c0746ed to c4c20ae Compare October 25, 2017 07:54
@gkalpak gkalpak added state: WIP and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 25, 2017
@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from c4c20ae to 9316f5b Compare October 25, 2017 08:02
@mary-poppins

Copy link
Copy Markdown

You can preview c4c20ae at https://pr19904-c4c20ae.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 9316f5b at https://pr19904-9316f5b.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 9316f5b to 5a78966 Compare October 25, 2017 09:27
@mary-poppins

Copy link
Copy Markdown

You can preview 5a78966 at https://pr19904-5a78966.ngbuilds.io/.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This relies on timezone (e.g. failed on my UTC+2 timezone 😞).
Using 12 as the hour it is more resilient to timezone differences (albeit not entirely immune) and thus more likely to pass when run locally.

@ocombe ocombe Oct 25, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yes, I had to change the match to use a regexp that doesn't check the last values, but I didn't think about the hour that could go to the other day. It's fine to use 12 instead of 22

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I noticed that there are several occurrences where types were a little loose or not-specific in compiler-cli-related stuff. For example nullable/"undefined-able" values typed as non-nullable (e.g. here, here, here) or values whose properties could be more strictly typed (e.g. the changes in this file), etc.

Is this expected/intentional, @tbosch, @chuckjaz?

Obviously, I don't understand enough about the implications of changing the types of these APIs 😁
Just bringing it up as my instinctive, very-high-level-understanding reaction/thought.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you leave TODO review comments anywhere where as any as is needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@tbosch, @chuckjaz: Not a big deal, but if it is possible to retrieve the JIT sources without spying on such a fundamental built-in (Function), I think it is worth doing. (The current approach is a little brittle.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you add comment // Work around for: https://github.com/jasmine/jasmine/issues/1573

Comment thread packages/router/src/url_tree.ts Outdated

@gkalpak gkalpak Oct 25, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is a public API change ({key: string} --> {key: any}) plus using the already public Params type for that.
But I think it is necessary, because this is what actually happens (i.e. the values are not restricted to string).

If a more specific type is desirable, I can dig deeper into what the possible types are and update (from a quick look it might just be string | string[]).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jasonaden will have to take a look at this. it looks like a breaking change to me, which we can't do now. Jason is this the same api change you were trying to make during v5 RC?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just to be clear, the public API type is wrong. It claims that queryParams values are always strings, but this is not the case. So, your app might typecheck fine, but break at runtime. But this change might indeed cause an app not to compile any more (for good reasons 😉)

LMK if it is better to remove it (and use as any in the tests to work around it).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just to be more clear, Params is alias for {[key: string]: any}, so it is wider than the previous type.

Comment thread tools/types-ext/jasminewd2.d.ts Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@vikerman (or anyone else working on jasminewd), should these changes be ported to DefinitelyTyped?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, you can send me a PR against the upstream typings on DefinitelyTyped, I'm a committer there

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 5a78966 to 8a3b7da Compare October 25, 2017 11:17
@gkalpak gkalpak changed the title build: upgrade jasmine to latest version build: upgrade jasmine (and related typings) to latest version Oct 25, 2017
@mary-poppins

Copy link
Copy Markdown

You can preview 8a3b7da at https://pr19904-8a3b7da.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 8a3b7da to 4e2adb2 Compare October 25, 2017 23:06
@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch 2 times, most recently from 1fdac95 to 97dfaf3 Compare July 5, 2018 19:07
@mary-poppins

Copy link
Copy Markdown

You can preview 1fdac95 at https://pr19904-1fdac95.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 97dfaf3 at https://pr19904-97dfaf3.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 97dfaf3 to 0f35833 Compare July 5, 2018 19:45
@mary-poppins

Copy link
Copy Markdown

You can preview 0f35833 at https://pr19904-0f35833.ngbuilds.io/.

@gkalpak
gkalpak force-pushed the build-upgrade-jasmine branch from 0f35833 to 1a3f52c Compare July 6, 2018 06:17
@mary-poppins

Copy link
Copy Markdown

You can preview 1a3f52c at https://pr19904-1a3f52c.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview b3a3be0 at https://pr19904-b3a3be0.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 8071de3 at https://pr19904-8071de3.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 0ebba85 at https://pr19904-0ebba85.ngbuilds.io/.

@gkalpak

gkalpak commented Jul 6, 2018

Copy link
Copy Markdown
Member Author

This is now ready for review 😅
(cc @mhevery, @rkirov)

@ngbot

ngbot Bot commented Jul 6, 2018

Copy link
Copy Markdown

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure forbidden label detected: PR action: review
    pending status "code-review/pullapprove" is pending
    pending status "google3" is pending

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

@mhevery

mhevery commented Jul 6, 2018 •

Copy link
Copy Markdown
Contributor

*/

import {AsyncTestCompleter, describe, expect, iit, inject, it} from '@angular/core/testing/src/testing_internal';
import {AsyncTestCompleter, describe, expect, fit, inject, it} from '@angular/core/testing/src/testing_internal';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oops?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

What was the problem??? 😕

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

AFAICT, everything was fine before (and Travis agrees with me 😛).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, had to revert my fit => iit change.

*/

import {ddescribe, describe, iit, it} from '@angular/core/testing/src/testing_internal';
import {ddescribe, describe, fit, it} from '@angular/core/testing/src/testing_internal';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oops?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

😕

@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@googlebot

Copy link
Copy Markdown

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

@mary-poppins

Copy link
Copy Markdown

You can preview edb5217 at https://pr19904-edb5217.ngbuilds.io/.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@angular-automatic-lock-bot

Copy link
Copy Markdown

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.

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 area: build & ci Related the build and CI infrastructure of the project cla: yes target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.