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

ci(language-service): enable language service tests in bazel #23001

Closed

Conversation

chuckjaz
Copy link
Contributor

PR Type

What kind of change does this PR introduce?

[x] CI related changes

What is the current behavior?

Tests for @angular/language-service only run in test.sh.

What is the new behavior?

Tests for @angular/language-service in bazel test.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@chuckjaz chuckjaz added the target: major This PR is targeted for the next major release label Mar 26, 2018
@mary-poppins
Copy link

You can preview b920e9d at https://pr23001-b920e9d.ngbuilds.io/.

@chuckjaz chuckjaz force-pushed the bazel_language_service_tests_2 branch from b920e9d to 6e63233 Compare March 28, 2018 20:56
@chuckjaz chuckjaz added target: major This PR is targeted for the next major release and removed target: major This PR is targeted for the next major release labels Mar 28, 2018
@mary-poppins
Copy link

You can preview 6e63233 at https://pr23001-6e63233.ngbuilds.io/.

@@ -512,6 +512,9 @@ class PipesTable implements SymbolTable {
values(): Symbol[] { return this.pipes.map(pipe => new PipeSymbol(pipe, this.context)); }
}

// This matches .d.ts files that look like ".../<package-name>/<package-name>.d.ts",
const INDEX_PATTERN = /[\\|/](\w+)[\\|/]\1\.d\.ts$/;
Copy link
Contributor

Choose a reason for hiding this comment

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

funny thing: you do not match package-name :)

Copy link
Contributor

@vicb vicb Mar 28, 2018

Choose a reason for hiding this comment

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

/(?:\\|/)(\w+)(?:\\|/)\1\.d\.ts$/;

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 am not sure what you are asking. I need to match /foo/foo.d.ts but not /foo/bar.d.ts.

if (isInBazel()) {
const support = setup();
this.angularPath = path.join(support.basePath, 'node_modules/@angular');
this.nodeModulesPath = path.join(support.basePath, 'node_modules');
Copy link
Contributor

Choose a reason for hiding this comment

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

compute the second one first and .join('@angular') ?

this.angularPath = path.join(support.basePath, 'node_modules/@angular');
this.nodeModulesPath = path.join(support.basePath, 'node_modules');
} else {
let angularIndex = moduleFilename.indexOf('@angular');
Copy link
Contributor

Choose a reason for hiding this comment

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

const

if (angularIndex >= 0)
this.angularPath =
moduleFilename.substr(0, angularIndex).replace('/all/', '/all/@angular/');
let distIndex = moduleFilename.indexOf('/dist/all');
Copy link
Contributor

Choose a reason for hiding this comment

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

const

const p = type.filePath as string;
const m = p.match(INDEX_PATTERN);
if (m) {
const indexVersion = path.join(p.substr(0, m.index ! + m[1].length + 1), 'index.d.ts');
Copy link
Contributor

@vicb vicb Mar 28, 2018

Choose a reason for hiding this comment

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

I find path.join(path.basename(p) + 'index.d.ts'; easier to understand

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

INDEX_PATTERN should be improved

@mary-poppins
Copy link

You can preview 04cc32a at https://pr23001-04cc32a.ngbuilds.io/.

@chuckjaz chuckjaz added the action: merge The PR is ready for merge by the caretaker label Mar 29, 2018
@alxhub alxhub closed this in 9fb08e2 Mar 29, 2018
@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 Sep 13, 2019
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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants