Skip to content

Commit ad82fb9

Browse files
committed
reorganize test directory
1 parent 778ad85 commit ad82fb9

15 files changed

+30
-9
lines changed
File renamed without changes.
File renamed without changes.

test/performance/traceTest.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
classdef traceTest < matlab.perftest.TestCase
22
% performance tests for tracing
33

4+
% Copyright 2023-2024 The MathWorks, Inc.
5+
46
properties
57
OtelConfigFile
68
JsonFile
@@ -17,7 +19,7 @@
1719
methods (TestClassSetup)
1820
function setupOnce(testCase)
1921
testdir = fileparts(mfilename("fullpath"));
20-
addpath(fullfile(testdir, "..")); % add directory where common setup and teardown code lives
22+
addpath(fullfile(testdir, "..", "utils")); % add directory where common setup and teardown code lives
2123
commonSetupOnce(testCase);
2224

2325
% create a global tracer provider

test/tbaggage.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef tbaggage < matlab.unittest.TestCase
22
% tests for creating and manipulating baggage object
33

4-
% Copyright 2023 The MathWorks, Inc.
4+
% Copyright 2023-2024 The MathWorks, Inc.
55

66
properties
77
BaggageKeys
@@ -15,7 +15,7 @@ function setupOnce(testCase)
1515

1616
% set up path
1717
if ~isempty(otelroot)
18-
addpath(otelroot);
18+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(otelroot));
1919
end
2020

2121
testCase.BaggageKeys = ["userId", "serverNode", "isProduction"];

test/tcontextPropagation.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef tcontextPropagation < matlab.unittest.TestCase
22
% tests for injecting and extracting context from HTTP headers
33

4-
% Copyright 2023 The MathWorks, Inc.
4+
% Copyright 2023-2024 The MathWorks, Inc.
55

66
properties
77
OtelConfigFile
@@ -25,6 +25,9 @@
2525

2626
methods (TestClassSetup)
2727
function setupOnce(testCase)
28+
% add the utils folder to the path
29+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
30+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2831
commonSetupOnce(testCase);
2932

3033
% simulate an HTTP header with relevant fields, used for extraction

test/tendpoint.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef tendpoint < matlab.unittest.TestCase
22
% tests for setting endpoint in the exporter
33

4-
% Copyright 2023 The MathWorks, Inc.
4+
% Copyright 2023-2024 The MathWorks, Inc.
55

66
properties
77
OtelConfigFile
@@ -18,13 +18,17 @@
1818

1919
methods (TestClassSetup)
2020
function setupOnce(testCase)
21+
% add the utils folder to the path
22+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
23+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2124
commonSetupOnce(testCase);
2225
end
2326
end
2427

2528
methods (TestMethodSetup)
2629
function setup(testCase)
27-
commonSetup(testCase, "nondefault_endpoint.yml");
30+
config = fullfile(fileparts(mfilename("fullpath")), "config", "nondefault_endpoint.yml");
31+
commonSetup(testCase, config);
2832
end
2933
end
3034

test/tmetrics.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
methods (TestClassSetup)
2525
function setupOnce(testCase)
26+
% add the utils folder to the path
27+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
28+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2629
commonSetupOnce(testCase);
2730

2831
% add the callbacks folder to the path

test/tmetrics_sdk.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
methods (TestClassSetup)
2222
function setupOnce(testCase)
23+
% add the utils folder to the path
24+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
25+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2326
commonSetupOnce(testCase);
2427
interval = seconds(2);
2528
timeout = seconds(1);

test/ttrace.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef ttrace < matlab.unittest.TestCase
22
% tests for traces and spans
33

4-
% Copyright 2023 The MathWorks, Inc.
4+
% Copyright 2023-2024 The MathWorks, Inc.
55

66
properties
77
OtelConfigFile
@@ -18,6 +18,9 @@
1818

1919
methods (TestClassSetup)
2020
function setupOnce(testCase)
21+
% add the utils folder to the path
22+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
23+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2124
commonSetupOnce(testCase);
2225
end
2326
end

test/ttrace_sdk.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef ttrace_sdk < matlab.unittest.TestCase
22
% tests for tracing SDK (span processors, exporters, samplers, resource)
33

4-
% Copyright 2023 The MathWorks, Inc.
4+
% Copyright 2023-2024 The MathWorks, Inc.
55

66
properties
77
OtelConfigFile
@@ -18,6 +18,9 @@
1818

1919
methods (TestClassSetup)
2020
function setupOnce(testCase)
21+
% add the utils folder to the path
22+
utilsfolder = fullfile(fileparts(mfilename('fullpath')), "utils");
23+
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(utilsfolder));
2124
commonSetupOnce(testCase);
2225
end
2326
end

0 commit comments

Comments
 (0)