Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bb46cb9
Add typed wrapper for checkOverlayEnablementMacro
henrymercer May 6, 2026
c9b4614
Add typed wrapper for parsePacksMacro
henrymercer May 6, 2026
5d8e363
Add typed wrapper for parsePacksErrorMacro
henrymercer May 6, 2026
2424923
Add typed wrapper for invalidPackNameMacro
henrymercer May 6, 2026
aa9aa2a
Add typed wrapper for packSpecPrettyPrintingMacro
henrymercer May 6, 2026
bfb5926
Add typed wrapper for calculateAugmentationMacro
henrymercer May 6, 2026
2a05095
Add typed wrapper for calculateAugmentationErrorMacro
henrymercer May 6, 2026
c8ef3e4
Add typed wrapper for sendFailedStatusReportMacro
henrymercer May 6, 2026
198be5a
Add typed wrapper for getCredentialsMacro
henrymercer May 6, 2026
2b77d7c
Add typed wrapper for wrapFailureMacro
henrymercer May 6, 2026
9fd1b43
Add typed wrapper for createInitWithConfigStatusReportMacro
henrymercer May 6, 2026
356809c
Add typed wrapper for downloadOverlayBaseDatabaseFromCacheMacro
henrymercer May 6, 2026
44e4709
Add typed wrapper for checkPacksForOverlayCompatibilityMacro
henrymercer May 6, 2026
67e427b
Add typed wrapper for postProcessAndUploadSarifMacro
henrymercer May 6, 2026
51cc915
Add typed wrapper for shouldPerformDiffInformedAnalysisMacro
henrymercer May 6, 2026
cd00cbb
Add typed wrapper for injectedConfigMacro
henrymercer May 6, 2026
231b974
Add typed wrapper for toolcacheInputFallbackMacro
henrymercer May 6, 2026
4104e68
Add typed wrapper for skippedUploadMacro
henrymercer May 6, 2026
c3b2b04
Improve `testInjectedConfig` type
henrymercer May 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 35 additions & 25 deletions src/codeql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
AugmentationProperties,
generateCodeScanningConfig,
defaultAugmentationProperties,
UserConfig,
} from "./config/db-config";
import type { Config } from "./config-utils";
import * as defaults from "./defaults.json";
Expand Down Expand Up @@ -545,7 +546,7 @@ const injectedConfigMacro = test.macro({
t: ExecutionContext<unknown>,
augmentationProperties: AugmentationProperties,
configOverride: Partial<Config>,
expectedConfig: any,
expectedConfig: UserConfig,
) => {
await util.withTmpDir(async (tempDir) => {
sinon.stub(actionsUtil, "isDefaultSetup").resolves(false);
Expand Down Expand Up @@ -590,19 +591,38 @@ const injectedConfigMacro = test.macro({
`databaseInitCluster() injected config: ${providedTitle}`,
});

test.serial(
/**
* Wraps `injectedConfigMacro` to improve type checking.
*
* When the macro is invoked directly, e.g. via `test.serial(macro, ...)`, the
* precise types of the arguments are erased.
*/
function testInjectedConfig(
title: string,
augmentationProperties: AugmentationProperties,
configOverride: Partial<Config>,
expectedConfig: UserConfig,
) {
Comment thread
henrymercer marked this conversation as resolved.
test.serial(
title,
injectedConfigMacro,
augmentationProperties,
configOverride,
expectedConfig,
);
}

testInjectedConfig(
"basic",
injectedConfigMacro,
{
...defaultAugmentationProperties,
},
{},
{},
);

test.serial(
testInjectedConfig(
"injected packs from input",
injectedConfigMacro,
{
...defaultAugmentationProperties,
packsInput: ["xxx", "yyy"],
Expand All @@ -613,9 +633,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected packs from input with existing packs combines",
injectedConfigMacro,
{
...defaultAugmentationProperties,
packsInputCombines: true,
Expand All @@ -635,9 +654,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected packs from input with existing packs overrides",
injectedConfigMacro,
{
...defaultAugmentationProperties,
packsInput: ["xxx", "yyy"],
Expand All @@ -655,9 +673,8 @@ test.serial(
);

// similar, but with queries
test.serial(
testInjectedConfig(
"injected queries from input",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
Expand All @@ -675,9 +692,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected queries from input overrides",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInput: [{ uses: "xxx" }, { uses: "yyy" }],
Expand All @@ -699,9 +715,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected queries from input combines",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: true,
Expand All @@ -727,9 +742,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected queries from input combines 2",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: true,
Expand All @@ -749,9 +763,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"injected queries and packs, but empty",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: true,
Expand All @@ -768,9 +781,8 @@ test.serial(
{},
);

test.serial(
testInjectedConfig(
"repo property queries have the highest precedence",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: true,
Expand All @@ -790,9 +802,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"repo property queries combines with queries input",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: false,
Expand All @@ -817,9 +828,8 @@ test.serial(
},
);

test.serial(
testInjectedConfig(
"repo property queries combines everything else",
injectedConfigMacro,
{
...defaultAugmentationProperties,
queriesInputCombines: true,
Expand Down
Loading
Loading