Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
corentinmusard committed May 9, 2024
1 parent 3a8d92b commit 97e5f0f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- feat: update otel dependencies to latest

## [1.9.1] - 2024-05-09

### Fixed
Expand Down
9 changes: 7 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119213,6 +119213,7 @@ function toLinks(links) {
function toAttributeValue(value) {
/* istanbul ignore else */
if ("stringValue" in value) {
/* istanbul ignore next */
return value.stringValue ?? undefined;
}
else if ("arrayValue" in value) {
Expand Down Expand Up @@ -119269,11 +119270,15 @@ async function traceOTLPFile({ tracer, parentSpan, path, }) {
for await (const line of rl) {
if (line) {
const serviceRequest = JSON.parse(line);
/* istanbul ignore next */
for (const resourceSpans of serviceRequest.resourceSpans ?? []) {
for (const scopeSpans of resourceSpans.scopeSpans) {
/* istanbul ignore next */
for (const scopeSpans of resourceSpans.scopeSpans ?? []) {
if (scopeSpans.scope) {
/* istanbul ignore next */
for (const otlpSpan of scopeSpans.spans ?? []) {
core.debug(`Trace Test ParentSpan<${otlpSpan.parentSpanId || parentSpan.spanContext().spanId}> -> Span<${otlpSpan.spanId}> `);
core.debug(`Trace Test ParentSpan<${otlpSpan.parentSpanId?.toString() ||
parentSpan.spanContext().spanId}> -> Span<${otlpSpan.spanId.toString()}> `);
addSpanToTracer(otlpSpan, tracer);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions dist/tracing/trace-otlp-file.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/tracing/trace-otlp-file.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/tracing/trace-otlp-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function toLinks(links: ILink[] | undefined): Link[] {
function toAttributeValue(value: IAnyValue): AttributeValue | undefined {
/* istanbul ignore else */
if ("stringValue" in value) {
/* istanbul ignore next */
return value.stringValue ?? undefined;
} else if ("arrayValue" in value) {
return JSON.stringify(value.arrayValue?.values);
Expand Down Expand Up @@ -129,14 +130,18 @@ export async function traceOTLPFile({
for await (const line of rl) {
if (line) {
const serviceRequest = JSON.parse(line) as IExportTraceServiceRequest;
/* istanbul ignore next */
for (const resourceSpans of serviceRequest.resourceSpans ?? []) {
for (const scopeSpans of resourceSpans.scopeSpans) {
/* istanbul ignore next */
for (const scopeSpans of resourceSpans.scopeSpans ?? []) {
if (scopeSpans.scope) {
/* istanbul ignore next */
for (const otlpSpan of scopeSpans.spans ?? []) {
core.debug(
`Trace Test ParentSpan<${
otlpSpan.parentSpanId || parentSpan.spanContext().spanId
}> -> Span<${otlpSpan.spanId}> `,
otlpSpan.parentSpanId?.toString() ||
parentSpan.spanContext().spanId
}> -> Span<${otlpSpan.spanId.toString()}> `,
);
addSpanToTracer(otlpSpan, tracer);
}
Expand Down

0 comments on commit 97e5f0f

Please sign in to comment.