@@ -37,11 +37,11 @@ protected KurrentPermanentFixture(ConfigureFixture configure) {
37
37
38
38
public ILogger Log => Logger ;
39
39
40
- public ITestService Service { get ; }
40
+ public ITestService Service { get ; }
41
41
public KurrentFixtureOptions Options { get ; }
42
- public Faker Faker { get ; } = new Faker ( ) ;
42
+ public Faker Faker { get ; } = new Faker ( ) ;
43
43
44
- public Version EventStoreVersion { get ; private set ; } = null ! ;
44
+ // public Version EventStoreVersion { get; private set; } = null!;
45
45
public bool EventStoreHasLastStreamPosition { get ; private set ; }
46
46
47
47
public KurrentClient Streams { get ; private set ; } = null ! ;
@@ -87,13 +87,12 @@ public async Task InitializeAsync() {
87
87
await ContainerSemaphore . WaitAsync ( ) ;
88
88
try {
89
89
await Service . Start ( ) ;
90
+ // EventStoreVersion = GetEventStoreVersion();
91
+ // EventStoreHasLastStreamPosition = (EventStoreVersion?.Major ?? int.MaxValue) >= 21;
90
92
} finally {
91
93
ContainerSemaphore . Release ( ) ;
92
94
}
93
95
94
- EventStoreVersion = GetEventStoreVersion ( ) ;
95
- EventStoreHasLastStreamPosition = ( EventStoreVersion ? . Major ?? int . MaxValue ) >= 21 ;
96
-
97
96
await WarmUpGatekeeper . WaitAsync ( ) ;
98
97
99
98
try {
@@ -133,36 +132,36 @@ async Task<T> InitClient<T>(Func<T, Task> action, bool execute = true) where T :
133
132
return client ;
134
133
}
135
134
136
- static Version GetEventStoreVersion ( ) {
137
- const string versionPrefix = "EventStoreDB version" ;
138
-
139
- using var cancellator = new CancellationTokenSource ( FromSeconds ( 30 ) ) ;
140
- using var eventstore = new Builder ( )
141
- . UseContainer ( )
142
- . UseImage ( GlobalEnvironment . DockerImage )
143
- . Command ( "--version" )
144
- . Build ( )
145
- . Start ( ) ;
146
-
147
- using var log = eventstore . Logs ( true , cancellator . Token ) ;
148
- foreach ( var line in log . ReadToEnd ( ) ) {
149
- if ( line . StartsWith ( versionPrefix ) &&
150
- Version . TryParse (
151
- new string ( ReadVersion ( line [ ( versionPrefix . Length + 1 ) ..] ) . ToArray ( ) ) ,
152
- out var version
153
- ) ) {
154
- return version ;
155
- }
156
- }
157
-
158
- throw new InvalidOperationException ( "Could not determine server version." ) ;
159
-
160
- IEnumerable < char > ReadVersion ( string s ) {
161
- foreach ( var c in s . TakeWhile ( c => c == '.' || char . IsDigit ( c ) ) ) {
162
- yield return c ;
163
- }
164
- }
165
- }
135
+ // static Version GetEventStoreVersion() {
136
+ // const string versionPrefix = "EventStoreDB version";
137
+ //
138
+ // using var cancellator = new CancellationTokenSource(FromSeconds(30));
139
+ // using var eventstore = new Builder()
140
+ // .UseContainer()
141
+ // .UseImage(GlobalEnvironment.DockerImage)
142
+ // .Command("--version")
143
+ // .Build()
144
+ // .Start();
145
+ //
146
+ // using var log = eventstore.Logs(true, cancellator.Token);
147
+ // foreach (var line in log.ReadToEnd()) {
148
+ // if (line.StartsWith(versionPrefix) &&
149
+ // Version.TryParse(
150
+ // new string(ReadVersion(line[(versionPrefix.Length + 1)..]).ToArray()),
151
+ // out var version
152
+ // )) {
153
+ // return version;
154
+ // }
155
+ // }
156
+ //
157
+ // throw new InvalidOperationException("Could not determine server version.");
158
+ //
159
+ // IEnumerable<char> ReadVersion(string s) {
160
+ // foreach (var c in s.TakeWhile(c => c == '.' || char.IsDigit(c))) {
161
+ // yield return c;
162
+ // }
163
+ // }
164
+ // }
166
165
}
167
166
168
167
public async Task DisposeAsync ( ) {
0 commit comments