Skip to content

Commit

Permalink
chore(otel): update config.unittest.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
waitingsong committed Oct 31, 2024
1 parent 7d3ab8d commit 891dc79
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/otel/src/config/config.unittest.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { join } from 'node:path'

import type { DefaultConfig as GClientConfig, IMidwayGRPFrameworkOptions } from '@midwayjs/grpc'
import { isFileExists, retrieveDirname } from '@waiting/shared-core'

import {
Expand Down Expand Up @@ -52,14 +53,15 @@ console.info({ APP_BASE_DIR, APP_DIST_DIR })


const protoPath = join(APP_BASE_DIR, 'test/grpc', 'helloworld.proto')
export const grpcServer = { services: [] }
export const grpc = { services: [] }
export const grpcServer: IMidwayGRPFrameworkOptions = {
// url: 'localhost:6565',
}
export const grpc: GClientConfig = { services: [] }
const rpcBaseConfig = { protoPath, package: 'helloworld' }

if (await isFileExists(protoPath)) {
// @ts-expect-error
grpcServer.services.push({ url: 'localhost:6565', protoPath, package: 'helloworld' })
// @ts-expect-error
grpc.services.push({ url: 'localhost:6565', protoPath, package: 'helloworld' })
grpcServer.services = [{ ...rpcBaseConfig }]
grpc.services.push({ ...rpcBaseConfig, url: 'localhost:6565' })
}


0 comments on commit 891dc79

Please sign in to comment.