fix: update to @google-cloud/[email protected]#772
Conversation
bc567d3 to
a45c503
Compare
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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 whichTraceWriterwould look for project IDs; others assumed that traces got buffered synchronously after being passed towriteSpan. 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-writerhas been completely re-written to be more behavior-driven.