Skip to content

Commit 9d8f981

Browse files
committed
Replace hardcoded path with getGherkinTestPath
Signed-off-by: Marko Mlakar <marko.mlakar@dynatrace.com>
1 parent 8d0d66a commit 9d8f981

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

libs/providers/flagd/src/e2e/step-definitions/providerSteps.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FlagdContainer } from '../tests/flagdContainer';
44
import type { State, Steps } from './state';
55
import { FlagdProvider } from '../../lib/flagd-provider';
66
import type { FlagdProviderOptions } from '../../lib/configuration';
7+
import { getGherkinTestPath } from '@openfeature/flagd-core';
78
import { resolve } from 'node:path';
89
import { existsSync } from 'node:fs';
910

@@ -48,10 +49,7 @@ export const providerSteps: Steps =
4849
case 'ssl': {
4950
flagdOptions['port'] = container.getPort(state.resolverType);
5051
flagdOptions['tls'] = true;
51-
const certPath = resolve(
52-
__dirname,
53-
'./../../../../../shared/flagd-core/test-harness/ssl/custom-root-cert.crt',
54-
);
52+
const certPath = resolve(getGherkinTestPath('custom-root-cert.crt', 'test-harness/ssl/'));
5553
flagdOptions['certPath'] = certPath;
5654
if (!existsSync(certPath)) {
5755
throw new Error('Certificate file not found at path: ' + certPath);

libs/providers/flagd/src/lib/service/common/grpc-util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { credentials } from '@grpc/grpc-js';
2-
import type { ClientReadableStream } from '@grpc/grpc-js';
2+
import type { ClientReadableStream, ChannelCredentials } from '@grpc/grpc-js';
33
import { readFileSync, existsSync } from 'node:fs';
44

55
export const closeStreamIfDefined = (stream: ClientReadableStream<unknown> | undefined) => {
@@ -21,7 +21,7 @@ export const closeStreamIfDefined = (stream: ClientReadableStream<unknown> | und
2121
* Creates gRPC channel credentials based on TLS and certificate path configuration.
2222
* @returns Channel credentials for gRPC connection
2323
*/
24-
export const createChannelCredentials = (tls: boolean, certPath?: string) => {
24+
export const createChannelCredentials = (tls: boolean, certPath?: string): ChannelCredentials => {
2525
if (!tls) {
2626
return credentials.createInsecure();
2727
}

0 commit comments

Comments
 (0)