@@ -46,6 +46,7 @@ export class FullConfigInternal {
46
46
readonly plugins : TestRunnerPluginRegistration [ ] ;
47
47
readonly projects : FullProjectInternal [ ] = [ ] ;
48
48
readonly singleTSConfigPath ?: string ;
49
+ readonly populateGitInfo : boolean ;
49
50
cliArgs : string [ ] = [ ] ;
50
51
cliGrep : string | undefined ;
51
52
cliGrepInvert : string | undefined ;
@@ -75,10 +76,15 @@ export class FullConfigInternal {
75
76
const privateConfiguration = ( userConfig as any ) [ '@playwright/test' ] ;
76
77
this . plugins = ( privateConfiguration ?. plugins || [ ] ) . map ( ( p : any ) => ( { factory : p } ) ) ;
77
78
this . singleTSConfigPath = pathResolve ( configDir , userConfig . tsconfig ) ;
79
+ this . populateGitInfo = takeFirst ( userConfig . populateGitInfo , false ) ;
78
80
79
81
this . globalSetups = ( Array . isArray ( userConfig . globalSetup ) ? userConfig . globalSetup : [ userConfig . globalSetup ] ) . map ( s => resolveScript ( s , configDir ) ) . filter ( script => script !== undefined ) ;
80
82
this . globalTeardowns = ( Array . isArray ( userConfig . globalTeardown ) ? userConfig . globalTeardown : [ userConfig . globalTeardown ] ) . map ( s => resolveScript ( s , configDir ) ) . filter ( script => script !== undefined ) ;
81
83
84
+ // Make sure we reuse same metadata instance between FullConfigInternal instances,
85
+ // so that plugins such as gitCommitInfoPlugin can populate metadata once.
86
+ userConfig . metadata = userConfig . metadata || { } ;
87
+
82
88
this . config = {
83
89
configFile : resolvedConfigFile ,
84
90
rootDir : pathResolve ( configDir , userConfig . testDir ) || configDir ,
@@ -90,7 +96,7 @@ export class FullConfigInternal {
90
96
grep : takeFirst ( userConfig . grep , defaultGrep ) ,
91
97
grepInvert : takeFirst ( userConfig . grepInvert , null ) ,
92
98
maxFailures : takeFirst ( configCLIOverrides . debug ? 1 : undefined , configCLIOverrides . maxFailures , userConfig . maxFailures , 0 ) ,
93
- metadata : takeFirst ( userConfig . metadata , { } ) ,
99
+ metadata : userConfig . metadata ,
94
100
preserveOutput : takeFirst ( userConfig . preserveOutput , 'always' ) ,
95
101
reporter : takeFirst ( configCLIOverrides . reporter , resolveReporters ( userConfig . reporter , configDir ) , [ [ defaultReporter ] ] ) ,
96
102
reportSlowTests : takeFirst ( userConfig . reportSlowTests , { max : 5 , threshold : 15000 } ) ,
0 commit comments