@@ -229,51 +229,6 @@ test("load code quality config", async (t) => {
229
229
} ) ;
230
230
} ) ;
231
231
232
- test ( "loading config saves config" , async ( t ) => {
233
- return await withTmpDir ( async ( tempDir ) => {
234
- const logger = getRunnerLogger ( true ) ;
235
-
236
- const codeql = createStubCodeQL ( {
237
- async betterResolveLanguages ( ) {
238
- return {
239
- extractors : {
240
- javascript : [ { extractor_root : "" } ] ,
241
- python : [ { extractor_root : "" } ] ,
242
- } ,
243
- } ;
244
- } ,
245
- } ) ;
246
-
247
- // Sanity check the saved config file does not already exist
248
- t . false ( fs . existsSync ( configUtils . getPathToParsedConfigFile ( tempDir ) ) ) ;
249
-
250
- // Sanity check that getConfig returns undefined before we have called initConfig
251
- t . deepEqual ( await configUtils . getConfig ( tempDir , logger ) , undefined ) ;
252
-
253
- const config1 = await configUtils . initConfig (
254
- createTestInitConfigInputs ( {
255
- languagesInput : "javascript,python" ,
256
- tempDir,
257
- codeql,
258
- workspacePath : tempDir ,
259
- logger,
260
- } ) ,
261
- ) ;
262
-
263
- // The saved config file should now exist
264
- t . true ( fs . existsSync ( configUtils . getPathToParsedConfigFile ( tempDir ) ) ) ;
265
-
266
- // And that same newly-initialised config should now be returned by getConfig
267
- const config2 = await configUtils . getConfig ( tempDir , logger ) ;
268
- t . not ( config2 , undefined ) ;
269
- if ( config2 !== undefined ) {
270
- // removes properties assigned to undefined.
271
- const expectedConfig = JSON . parse ( JSON . stringify ( config1 ) ) ;
272
- t . deepEqual ( expectedConfig , config2 ) ;
273
- }
274
- } ) ;
275
- } ) ;
276
-
277
232
test ( "loading config with version mismatch throws" , async ( t ) => {
278
233
return await withTmpDir ( async ( tempDir ) => {
279
234
const logger = getRunnerLogger ( true ) ;
@@ -300,7 +255,7 @@ test("loading config with version mismatch throws", async (t) => {
300
255
. stub ( actionsUtil , "getActionVersion" )
301
256
. returns ( "does-not-exist" ) ;
302
257
303
- await configUtils . initConfig (
258
+ const config = await configUtils . initConfig (
304
259
createTestInitConfigInputs ( {
305
260
languagesInput : "javascript,python" ,
306
261
tempDir,
@@ -309,6 +264,8 @@ test("loading config with version mismatch throws", async (t) => {
309
264
logger,
310
265
} ) ,
311
266
) ;
267
+ // initConfig does not save the config, so we do it here.
268
+ await configUtils . saveConfig ( config , logger ) ;
312
269
313
270
// Restore `getActionVersion`.
314
271
getActionVersionStub . restore ( ) ;
0 commit comments