Skip to content

Commit 92bb994

Browse files
committed
CI tryout
1 parent 3de3516 commit 92bb994

File tree

3 files changed

+7
-29
lines changed

3 files changed

+7
-29
lines changed

Diff for: Build.ps1

+5-7
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,16 @@ function FetchBaseBranchIfNotMaster(){
106106

107107
FetchBaseBranchIfNotMaster
108108

109-
# dotnet tool restore
110-
# CheckLastExitCode
109+
dotnet tool restore
110+
CheckLastExitCode
111111

112-
# dotnet build -c Release
113-
# CheckLastExitCode
112+
dotnet build -c Release
113+
CheckLastExitCode
114114

115115
# RunInspectCode
116116
# RunCleanupCode
117117

118-
# dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
119-
120-
dotnet test test/OpenApiTests
118+
dotnet test -c Release --no-build --collect:"XPlat Code Coverage"
121119

122120
CheckLastExitCode
123121

Diff for: test/OpenApiTests/NamingConvention/OpenApiTestContext.cs

+1-21
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ public async Task InitializeAsync()
2121

2222
string content = await GetAsync("swagger/v1/swagger.json");
2323

24-
25-
bool isInCi = IsCiBuildExecution();
26-
27-
// if (!isInCi)
28-
// {
29-
// // We don't need to write anything to disk in the CI
30-
// await WriteSwaggerDocumentToFileAsync(content);
31-
// }
24+
await WriteSwaggerDocumentToFileAsync(content);
3225

3326
JsonDocument parsedContent = JsonDocument.Parse(content);
3427

@@ -45,19 +38,6 @@ private async Task<string> GetAsync(string requestUrl)
4538
return await responseMessage.Content.ReadAsStringAsync();
4639
}
4740

48-
private static bool IsCiBuildExecution()
49-
{
50-
string? ciEnvironmentVariable = Environment.GetEnvironmentVariable("CI");
51-
52-
if (bool.TryParse(ciEnvironmentVariable, out var isCiBuildExecution))
53-
{
54-
return isCiBuildExecution;
55-
}
56-
57-
return false;
58-
}
59-
60-
6141
private async Task WriteSwaggerDocumentToFileAsync(string document)
6242
{
6343
string testSuitePath = GetTestSuitePath();

Diff for: test/TestBuildingBlocks/IntegrationTestContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ public class IntegrationTestContext<TStartup, TDbContext> : IntegrationTest, IDi
3131
where TStartup : class
3232
where TDbContext : DbContext
3333
{
34+
private readonly Lazy<WebApplicationFactory<TStartup>> _lazyFactory;
3435
private readonly TestControllerProvider _testControllerProvider = new();
3536
private Action<ILoggingBuilder>? _loggingConfiguration;
3637
private Action<IServiceCollection>? _beforeServicesConfiguration;
3738
private Action<IServiceCollection>? _afterServicesConfiguration;
38-
private readonly Lazy<WebApplicationFactory<TStartup>> _lazyFactory;
3939

4040
protected override JsonSerializerOptions SerializerOptions
4141
{

0 commit comments

Comments
 (0)