Skip to content

Commit 6fc58a5

Browse files
michaelklishinlukebakken
authored andcommitted
Merge pull request #1141 from rabbitmq/lukebakken/fix-appveyor
Fix and update AppVeyor build (cherry picked from commit 4628927)
1 parent 1e08a3c commit 6fc58a5

File tree

11 files changed

+185
-188
lines changed

11 files changed

+185
-188
lines changed

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

appveyor.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ version: "7.0.0.{build}"
33
platform: Any CPU
44
configuration: Release
55
skip_tags: true
6-
skip_branch_with_pr: true
76
image: Visual Studio 2019
87

98
cache:
109
# Note: this must match the $rabbitmq_installer_path and $erlang_installer_path values in
1110
# tools\appveyor\install.ps1
12-
- "%HOMEDRIVE%%HOMEPATH%\\rabbitmq-server-3.8.9.exe"
13-
- "%HOMEDRIVE%%HOMEPATH%\\otp_win64_23.1.2.exe"
11+
- "%HOMEDRIVE%%HOMEPATH%\\rabbitmq-server-3.9.13.exe"
12+
- "%HOMEDRIVE%%HOMEPATH%\\otp_win64_24.2.1.exe"
1413

1514
install:
1615
- ps: .\tools\appveyor\install.ps1

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@ECHO OFF
22
set DOTNET_CLI_TELEMETRY_OPTOUT=1
33
dotnet restore .\RabbitMQDotNetClient.sln
4-
dotnet run -p .\projects\Apigen\Apigen.csproj --apiName:AMQP_0_9_1 .\projects\specs\amqp0-9-1.stripped.xml .\gensrc\autogenerated-api-0-9-1.cs
4+
dotnet run --project .\projects\Apigen\Apigen.csproj --apiName:AMQP_0_9_1 .\projects\specs\amqp0-9-1.stripped.xml .\gensrc\autogenerated-api-0-9-1.cs
55
dotnet build .\RabbitMQDotNetClient.sln

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fi
1414
cd "$script_dir"
1515

1616
dotnet restore ./RabbitMQDotNetClient.sln
17-
dotnet run -p ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 \
17+
dotnet run --project ./projects/Apigen/Apigen.csproj --apiName:AMQP_0_9_1 \
1818
./projects/specs/amqp0-9-1.stripped.xml \
1919
./gensrc/autogenerated-api-0-9-1.cs
2020
dotnet build ./RabbitMQDotNetClient.sln

projects/RabbitMQ.Client/client/impl/IncomingCommand.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ public void Dispose()
2929
ArrayPool<byte>.Shared.Return(_rentedArray);
3030
}
3131
}
32+
33+
public override string ToString()
34+
{
35+
return $"IncomingCommand Method={Method.ProtocolMethodName}, Body.Length={Body.Length}";
36+
}
3237
}
3338
}

projects/Unit/APIApproval.Approve.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,4 +883,4 @@ namespace RabbitMQ.Client.Logging
883883
public string Type { get; }
884884
public override string ToString() { }
885885
}
886-
}
886+
}

projects/Unit/Fixtures.cs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ internal Process ExecCommand(string command, string args)
504504
return ExecCommand(command, args, null);
505505
}
506506

507-
internal Process ExecCommand(string ctl, string args, string changeDirTo)
507+
internal Process ExecCommand(string cmd, string args, string changeDirTo)
508508
{
509509
var proc = new Process
510510
{
@@ -514,31 +514,25 @@ internal Process ExecCommand(string ctl, string args, string changeDirTo)
514514
UseShellExecute = false
515515
}
516516
};
517-
if(changeDirTo != null)
517+
518+
if (changeDirTo != null)
518519
{
519520
proc.StartInfo.WorkingDirectory = changeDirTo;
520521
}
521522

522-
string cmd;
523-
if(IsRunningOnMonoOrDotNetCore()) {
524-
cmd = ctl;
525-
} else {
526-
cmd = "cmd.exe";
527-
args = $"/c \"\"{ctl}\" {args}\"";
528-
}
529-
530523
try {
531524
proc.StartInfo.FileName = cmd;
532525
proc.StartInfo.Arguments = args;
533526
proc.StartInfo.RedirectStandardError = true;
534527
proc.StartInfo.RedirectStandardOutput = true;
535528

536529
proc.Start();
537-
string stderr = proc.StandardError.ReadToEnd();
538530
proc.WaitForExit();
531+
532+
string stderr = proc.StandardError.ReadToEnd();
539533
if (stderr.Length > 0 || proc.ExitCode > 0)
540534
{
541-
string stdout = proc.StandardOutput.ReadToEnd();
535+
string stdout = proc.StandardOutput.ReadToEnd();
542536
ReportExecFailure(cmd, args, $"{stderr}\n{stdout}");
543537
}
544538

@@ -649,21 +643,21 @@ internal List<ConnectionInfo> ListConnections()
649643
internal void CloseConnection(IConnection conn)
650644
{
651645
ConnectionInfo ci = ListConnections().First(x => conn.ClientProvidedName == x.Name);
652-
CloseConnection(ci.Pid);
646+
CloseConnection(conn.ClientProvidedName, ci.Pid);
653647
}
654648

655649
internal void CloseAllConnections()
656650
{
657651
List<ConnectionInfo> cs = ListConnections();
658652
foreach(ConnectionInfo c in cs)
659653
{
660-
CloseConnection(c.Pid);
654+
CloseConnection(c.Name, c.Pid);
661655
}
662656
}
663657

664-
internal void CloseConnection(string pid)
658+
internal void CloseConnection(string name, string pid)
665659
{
666-
ExecRabbitMQCtl($"close_connection \"{pid}\" \"Closed via rabbitmqctl\"");
660+
ExecRabbitMQCtl($"close_connection \"{pid}\" \"{name} {pid} closed via rabbitmqctl\"");
667661
}
668662

669663
internal void RestartRabbitMQ()

0 commit comments

Comments
 (0)