Skip to content

Commit c6cc137

Browse files
committed
Fix assertions and features for tests
1 parent 251f480 commit c6cc137

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

‎src/languages/traced.test.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ test(`checkRunnerSupportsTracedAnalysis doesn't throw for BMN`, async (t) =>
8686
const logger = new RecordingLogger();
8787
const env = getTestEnv();
8888
env.set(ActionsEnvVars.RUNNER_TEMP, tmpDir);
89+
const features = createFeatures([Feature.CheckUnsupportedTracedAnalysis]);
8990

9091
const codeql = await getCodeQLWithTracedStub(
9192
"codeql-for-testing",
@@ -101,11 +102,16 @@ test(`checkRunnerSupportsTracedAnalysis doesn't throw for BMN`, async (t) =>
101102
osRelease: "27.0.0",
102103
env,
103104
logger,
105+
features,
104106
}),
105107
createTestConfig({ tempDir: tmpDir, buildMode: BuildMode.None }),
106108
codeql,
107109
),
108110
);
111+
112+
checkExpectedLogMessages(t, logger.messages, [
113+
"Skipping traced analysis compatibility checks because the build mode is 'none'.",
114+
]);
109115
}));
110116

111117
// Some languages not in `TEST_DEFAULT_TRACED_LANGUAGES`.
@@ -119,6 +125,7 @@ for (const nonTracedLanguage of nonTracedLanguages) {
119125
const logger = new RecordingLogger();
120126
const env = getTestEnv();
121127
env.set(ActionsEnvVars.RUNNER_TEMP, tmpDir);
128+
const features = createFeatures([Feature.CheckUnsupportedTracedAnalysis]);
122129

123130
const codeql = await getCodeQLWithTracedStub(
124131
"codeql-for-testing",
@@ -134,11 +141,16 @@ for (const nonTracedLanguage of nonTracedLanguages) {
134141
osRelease: "27.0.0",
135142
env,
136143
logger,
144+
features,
137145
}),
138146
createTestConfig({ tempDir: tmpDir, languages: [nonTracedLanguage] }),
139147
codeql,
140148
),
141149
);
150+
151+
checkExpectedLogMessages(t, logger.messages, [
152+
"Skipping traced analysis compatibility checks because no traced languages are being analyzed.",
153+
]);
142154
}));
143155
}
144156

@@ -147,7 +159,7 @@ test("checkRunnerSupportsTracedAnalysis doesn't perform checks if FF is not enab
147159
const logger = new RecordingLogger();
148160
const env = getTestEnv();
149161
env.set(ActionsEnvVars.RUNNER_TEMP, tmpDir);
150-
const features = createFeatures([]);
162+
const features = createFeatures([Feature.CheckUnsupportedTracedAnalysis]);
151163

152164
const codeql = await getCodeQLWithTracedStub(
153165
"codeql-for-testing",
@@ -169,7 +181,7 @@ test("checkRunnerSupportsTracedAnalysis doesn't perform checks if FF is not enab
169181
);
170182

171183
checkUnexpectedLogMessages(t, logger.messages, [
172-
"Unable to parse Darwin kernel version, got: unexpected",
184+
"Skipping traced analysis compatibility checks because the feature is not enabled.",
173185
]);
174186
}));
175187

0 commit comments

Comments
 (0)