Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

fix: update to @google-cloud/[email protected]#772

Merged
kjin merged 5 commits intogoogleapis:masterfrom
kjin:gcc
Jun 8, 2018
Merged

fix: update to @google-cloud/[email protected]#772
kjin merged 5 commits intogoogleapis:masterfrom
kjin:gcc

Conversation

@kjin
Copy link
Copy Markdown
Contributor

@kjin kjin commented Jun 6, 2018

Fixes #764 and fixes #638

This PR upgrades the dependency on @google-cloud/common.

Why are there so many test changes?

This PR changes implementation details of TraceWriter. Some tests assumed a certain order of precedence in which TraceWriter would look for project IDs; others assumed that traces got buffered synchronously after being passed to writeSpan. These are both implementation details, and they both changed.

As a result of these now invalid assumptions (especially the second one) virtually every test, except the ones that had been written/re-written recently, failed. I got through refactoring some of them before putting a stop-gap in TraceWriter -- it is far too painful to edit every test in one fell swoop.

In particular, the Trace Writer test test-trace-writer has been completely re-written to be more behavior-driven.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 6, 2018
@kjin kjin force-pushed the gcc branch 3 times, most recently from bc567d3 to a45c503 Compare June 7, 2018 22:23
@kjin kjin requested a review from a team June 7, 2018 22:41
Comment thread src/trace-writer.ts Outdated
this.logger = logger;
this.config = config;
// Clone the config object
this.config = Object.assign({}, config);

This comment was marked as spam.

This comment was marked as spam.

Comment thread src/trace-writer.ts
// buffered synchronously. We need to refactor those tests to remove that
// assumption before we can make this fix.
if (this.config.projectId) {
afterProjectId(this.config.projectId);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread src/trace-writer.ts Outdated
this.getProjectId().then(afterProjectId, (err: Error) => {
this.logger.info(
'TraceWriter#queueTrace: No project ID, dropping trace.');
return; // if we even reach this point, disabling traces is already

This comment was marked as spam.

This comment was marked as spam.

Comment thread test/logger.ts
new OriginalLogger({level: logger.LEVELS[PASS_THROUGH_LOG_LEVEL]});

private makeLoggerFn(logLevel: keyof Logger): LoggerFunction {
constructor(options?: Partial<LoggerConfig>) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@kjin kjin merged commit 3f3f667 into googleapis:master Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let users provide Project Id via GOOGLE_APPLICATION_CREDENTIALS

3 participants