@@ -64,11 +64,20 @@ public class YamlTestExtension implements TestTemplateInvocationContextProvider,
64
64
private List <YamlTestConfig > testConfigs ;
65
65
private List <YamlTestConfig > maintainConfigs ;
66
66
private List <ExternalServer > servers ;
67
+ private final String clusterFile ;
68
+
69
+ public YamlTestExtension () {
70
+ this .clusterFile = System .getenv ("FDB_CLUSTER_FILE" );
71
+ }
72
+
73
+ public YamlTestExtension (final String clusterFile ) {
74
+ this .clusterFile = clusterFile ;
75
+ }
67
76
68
77
@ Override
69
78
public void beforeAll (final ExtensionContext context ) throws Exception {
70
79
if (Boolean .parseBoolean (System .getProperty ("tests.runQuick" , "false" ))) {
71
- testConfigs = List .of (new EmbeddedConfig ());
80
+ testConfigs = List .of (new EmbeddedConfig (clusterFile ));
72
81
maintainConfigs = List .of ();
73
82
} else {
74
83
AtomicInteger serverPort = new AtomicInteger (1111 );
@@ -78,7 +87,9 @@ public void beforeAll(final ExtensionContext context) throws Exception {
78
87
// Potentially, we can relax this a little if all tests are disabled for multi-server execution, but this is
79
88
// not a likely scenario.
80
89
Assertions .assertFalse (jars .isEmpty (), "There are no external servers available to run" );
81
- servers = jars .stream ().map (jar -> new ExternalServer (jar , serverPort .getAndIncrement (), serverPort .getAndIncrement ())).collect (Collectors .toList ());
90
+ servers = jars .stream ()
91
+ .map (jar -> new ExternalServer (jar , serverPort .getAndIncrement (), serverPort .getAndIncrement (), clusterFile ))
92
+ .collect (Collectors .toList ());
82
93
for (ExternalServer server : servers ) {
83
94
server .start ();
84
95
}
@@ -94,10 +105,10 @@ public void beforeAll(final ExtensionContext context) throws Exception {
94
105
externalServerConfigs ).collect (Collectors .toList ());
95
106
96
107
maintainConfigs = List .of (
97
- new CorrectExplains (new EmbeddedConfig ()),
98
- new CorrectMetrics (new EmbeddedConfig ()),
99
- new CorrectExplainsAndMetrics (new EmbeddedConfig ()),
100
- new ShowPlanOnDiff (new EmbeddedConfig ())
108
+ new CorrectExplains (new EmbeddedConfig (clusterFile )),
109
+ new CorrectMetrics (new EmbeddedConfig (clusterFile )),
110
+ new CorrectExplainsAndMetrics (new EmbeddedConfig (clusterFile )),
111
+ new ShowPlanOnDiff (new EmbeddedConfig (clusterFile ))
101
112
);
102
113
}
103
114
for (final YamlTestConfig testConfig : Iterables .concat (testConfigs , maintainConfigs )) {
@@ -109,7 +120,7 @@ private Stream<YamlTestConfig> localConfigs(final boolean mixedModeOnly, final b
109
120
if (mixedModeOnly || singleExternalVersionOnly ) {
110
121
return Stream .of ();
111
122
} else {
112
- return Stream .of (new EmbeddedConfig (), new JDBCInProcessConfig ());
123
+ return Stream .of (new EmbeddedConfig (clusterFile ), new JDBCInProcessConfig (clusterFile ));
113
124
}
114
125
}
115
126
@@ -124,10 +135,10 @@ private Stream<YamlTestConfig> externalServerConfigs(final boolean singleExterna
124
135
} else {
125
136
return servers .stream ().flatMap (server ->
126
137
// (4 configs for each server available)
127
- Stream .of (new JDBCMultiServerConfig (0 , server ),
128
- new ForceContinuations (new JDBCMultiServerConfig (0 , server )),
129
- new JDBCMultiServerConfig (1 , server ),
130
- new ForceContinuations (new JDBCMultiServerConfig (1 , server ))));
138
+ Stream .of (new JDBCMultiServerConfig (0 , server , clusterFile ),
139
+ new ForceContinuations (new JDBCMultiServerConfig (0 , server , clusterFile )),
140
+ new JDBCMultiServerConfig (1 , server , clusterFile ),
141
+ new ForceContinuations (new JDBCMultiServerConfig (1 , server , clusterFile ))));
131
142
}
132
143
}
133
144
0 commit comments