Skip to content

Commit 1c46aae

Browse files
committed
Disable https listening in WebApiTest.cs
It doesn't play nice with CI environments.
1 parent 210e2e4 commit 1c46aae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/ILLink.Tasks.IntegrationTests/WebApiTest.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public string SetupProject ()
3636
Assert.True (false);
3737
}
3838

39+
DisableHttps (projectRoot);
40+
3941
PreventPublishFiltering (csproj);
4042

4143
AddLinkerReference (csproj);
@@ -64,6 +66,15 @@ private void PreventPublishFiltering (string csproj)
6466
xdoc.Save (fs);
6567
}
6668
}
69+
70+
private void DisableHttps (string projectRoot)
71+
{
72+
// Web API templates use https auth but this causes issues in CI environments which don't trust the dev cert
73+
string launchSettingsFile = Path.Combine (projectRoot, "Properties", "launchSettings.json");
74+
string launchSettingsContents = File.ReadAllText (launchSettingsFile);
75+
launchSettingsContents = launchSettingsContents.Replace ("https://localhost", "http://localhost");
76+
File.WriteAllText (launchSettingsFile, launchSettingsContents);
77+
}
6778
}
6879

6980
public class WebApiTest : IntegrationTestBase, IClassFixture<WebApiFixture>

0 commit comments

Comments
 (0)