mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-20 17:42:50 +08:00
another script change to find error
This commit is contained in:
parent
d4f972125e
commit
4d3a7ae5e1
44
build.cake
44
build.cake
@ -298,34 +298,42 @@ Task("DownloadGitHubReleaseArtifacts")
|
|||||||
.IsDependentOn("UpdateVersionInfo")
|
.IsDependentOn("UpdateVersionInfo")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
Information("DownloadGitHubReleaseArtifacts");
|
try
|
||||||
|
{
|
||||||
|
Information("DownloadGitHubReleaseArtifacts");
|
||||||
|
|
||||||
EnsureDirectoryExists(packagesDir);
|
EnsureDirectoryExists(packagesDir);
|
||||||
|
|
||||||
Information("Directory exists...");
|
Information("Directory exists...");
|
||||||
|
|
||||||
var releaseUrl = tagsUrl + releaseTag;
|
var releaseUrl = tagsUrl + releaseTag;
|
||||||
|
|
||||||
Information("Release url " + releaseUrl);
|
Information("Release url " + releaseUrl);
|
||||||
|
|
||||||
var assets_url = ParseJson(GetResource(releaseUrl))
|
var assets_url = ParseJson(GetResource(releaseUrl))
|
||||||
.GetValue("assets_url")
|
.GetValue("assets_url")
|
||||||
.Value<string>();
|
.Value<string>();
|
||||||
|
|
||||||
Information("Assets url " + assets_url);
|
Information("Assets url " + assets_url);
|
||||||
|
|
||||||
foreach(var asset in DeserializeJson<JArray>(GetResource(assets_url)))
|
foreach(var asset in DeserializeJson<JArray>(GetResource(assets_url)))
|
||||||
{
|
{
|
||||||
Information("In the loop..");
|
Information("In the loop..");
|
||||||
|
|
||||||
var file = packagesDir + File(asset.Value<string>("name"));
|
var file = packagesDir + File(asset.Value<string>("name"));
|
||||||
|
|
||||||
Information("Downloading " + file);
|
Information("Downloading " + file);
|
||||||
|
|
||||||
DownloadFile(asset.Value<string>("browser_download_url"), file);
|
DownloadFile(asset.Value<string>("browser_download_url"), file);
|
||||||
}
|
}
|
||||||
|
|
||||||
Information("Out of the loop...");
|
Information("Out of the loop...");
|
||||||
|
}
|
||||||
|
catch(Exception exception)
|
||||||
|
{
|
||||||
|
Information("There was an exception " + exception);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Task("ReleasePackagesToStableFeed")
|
Task("ReleasePackagesToStableFeed")
|
||||||
|
@ -61,6 +61,47 @@ namespace Ocelot.AcceptanceTests
|
|||||||
.BDDfy();
|
.BDDfy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void bug()
|
||||||
|
{
|
||||||
|
var configuration = new FileConfiguration
|
||||||
|
{
|
||||||
|
ReRoutes = new List<FileReRoute>
|
||||||
|
{
|
||||||
|
new FileReRoute
|
||||||
|
{
|
||||||
|
DownstreamPathTemplate = "/api/v1/vacancy",
|
||||||
|
DownstreamScheme = "http",
|
||||||
|
DownstreamHost = "localhost",
|
||||||
|
DownstreamPort = 51879,
|
||||||
|
UpstreamPathTemplate = "/vacancy/",
|
||||||
|
UpstreamHttpMethod = new List<string> { "Options", "Put", "Get", "Post", "Delete" },
|
||||||
|
ServiceName = "botCore",
|
||||||
|
LoadBalancer = "LeastConnection"
|
||||||
|
},
|
||||||
|
new FileReRoute
|
||||||
|
{
|
||||||
|
DownstreamPathTemplate = "/api/v1/vacancy/{vacancyId}",
|
||||||
|
DownstreamScheme = "http",
|
||||||
|
DownstreamHost = "localhost",
|
||||||
|
DownstreamPort = 51879,
|
||||||
|
UpstreamPathTemplate = "/vacancy/{vacancyId}",
|
||||||
|
UpstreamHttpMethod = new List<string> { "Options", "Put", "Get", "Post", "Delete" },
|
||||||
|
ServiceName = "botCore",
|
||||||
|
LoadBalancer = "LeastConnection"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
this.Given(x => x.GivenThereIsAServiceRunningOn("http://localhost:51879/api/v1/vacancy/1", 200, "Hello from Laura"))
|
||||||
|
.And(x => _steps.GivenThereIsAConfiguration(configuration))
|
||||||
|
.And(x => _steps.GivenOcelotIsRunning())
|
||||||
|
.When(x => _steps.WhenIGetUrlOnTheApiGateway("/vacancy/1"))
|
||||||
|
.Then(x => _steps.ThenTheStatusCodeShouldBe(HttpStatusCode.OK))
|
||||||
|
.And(x => _steps.ThenTheResponseBodyShouldBe("Hello from Laura"))
|
||||||
|
.BDDfy();
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void should_return_response_200_when_path_missing_forward_slash_as_first_char()
|
public void should_return_response_200_when_path_missing_forward_slash_as_first_char()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user