-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Concept start end notify runner (#206)
* Handle Runner concept start and end Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Update ExecutableRunnerServiceHandler with concept start and end tasks Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Updated StepFrom creating StepDetails Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Concept related Step info update Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Updated generating from proto files Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Updated generating from proto files Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Add support for Concept hooks Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Added gauge-proto as a submodule Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Fixed ShouldMapStepDetails test Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Updated Gauge.CSharp.Lib version in _testdata projects Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> * Added Concept hooks and updated Gauge.CSharp.Lib.dll in test projects Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com> --------- Signed-off-by: Piotr Nestorow <piotr.nestorow@systemverification.com>
- Loading branch information
1 parent
2523639
commit 5a9f766
Showing
41 changed files
with
35,980 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "gauge-proto"] | ||
path = gauge-proto | ||
url = https://github.com/getgauge/gauge-proto.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4 KB
(130%)
_testdata/SampleProjectReference/gauge_bin/Gauge.CSharp.Lib.dll
Binary file not shown.
Submodule gauge-proto
added at
9e50db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ---------------------------------------------------------------- | ||
# Copyright (c) ThoughtWorks, Inc. | ||
# Licensed under the Apache License, Version 2.0 | ||
# See LICENSE.txt in the project root for license information. | ||
# ---------------------------------------------------------------- | ||
|
||
dotnet restore | ||
|
||
$grpc_tools_version = "2.61.0" | ||
$grpc_tools = Join-Path $HOME ".nuget\packages\grpc.tools\$grpc_tools_version\tools" | ||
|
||
$protoc = $null | ||
$grpc_csharp = $null | ||
|
||
if ($env:PROCESSOR_ARCHITECTURE -match 64){ | ||
$protoc = Resolve-Path $grpc_tools\windows_x64\protoc.exe | ||
$grpc_csharp = Resolve-Path $grpc_tools\windows_x64\grpc_csharp_plugin.exe | ||
} | ||
else { | ||
$protoc = Resolve-Path $grpc_tools\windows_x86\protoc.exe | ||
$grpc_csharp = Resolve-Path $grpc_tools\windows_x86\grpc_csharp_plugin.exe | ||
} | ||
|
||
Write-Host "Generating Proto Classes.." | ||
|
||
|
||
gci ".\gauge-proto" -Filter "*.proto" | %{ | ||
Write-Host "Generating classes for $_" | ||
&$protoc @('-I.\gauge-proto', '--csharp_out=.\src\Gauge.CSharp.Core','--grpc_out=.\src\Gauge.CSharp.Core',"--plugin=protoc-gen-grpc=$grpc_csharp", ".\gauge-proto\$_") | ||
} | ||
|
||
Write-Host "Done!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#! /bin/bash | ||
|
||
set_os_architecture() { | ||
echo "Detecting architecture" | ||
local _ostype="$(uname -s)" | ||
local _cputype="$(uname -m)" | ||
|
||
echo "uname -s reports: $_ostype" | ||
echo "uname -m reports: $_cputype" | ||
|
||
if [ "$_ostype" = Darwin -a "$_cputype" = i386 ]; then | ||
# Darwin `uname -s` lies | ||
if sysctl hw.optional.x86_64 | grep -q ': 1'; then | ||
local _cputype=x86_64 | ||
fi | ||
fi | ||
|
||
case "$_ostype" in | ||
|
||
Linux) | ||
local _ostype=linux | ||
;; | ||
Darwin) | ||
local _ostype=macosx | ||
;; | ||
*) | ||
#err "Unknown OS type: $_ostype" | ||
;; | ||
esac | ||
|
||
case "$_cputype" in | ||
|
||
i386 | i486 | i686 | i786 | x86) | ||
local _cputype=x86 | ||
;; | ||
x86_64 | x86-64 | x64 | amd64) | ||
local _cputype=x64 | ||
;; | ||
*) | ||
#err "Unknown CPU type: $_cputype" | ||
;; | ||
esac | ||
|
||
echo "OS is $_ostype" | ||
echo "Architecture is $_cputype" | ||
ARCH="$_cputype" | ||
OS="$_ostype" | ||
} | ||
|
||
|
||
set_os_architecture | ||
|
||
dotnet restore | ||
|
||
grpc_tools_version="2.61.0" | ||
protoc="$HOME"/.nuget/packages/build/grpc.tools/"grpc_tools_version"/tools/"$OS"_"$ARCH"/protoc | ||
grpc_csharp="$HOME"/.nuget/packages/build/grpc.tools/"grpc_tools_version"/tools/"$OS"_"$ARCH"/grpc_csharp_plugin | ||
|
||
chmod +x $protoc | ||
chmod +x $grpc_csharp | ||
|
||
echo "Generating Proto Classes.." | ||
|
||
for i in `ls ./gauge-proto/*.proto`; do | ||
$protoc -I./gauge-proto --csharp_out=./src/Gauge.CSharp.Core --grpc_out=./src/Gauge.CSharp.Core --plugin=protoc-gen-grpc=$grpc_csharp $i | ||
done | ||
|
||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*---------------------------------------------------------------- | ||
* Copyright (c) ThoughtWorks, Inc. | ||
* Licensed under the Apache License, Version 2.0 | ||
* See LICENSE.txt in the project root for license information. | ||
*----------------------------------------------------------------*/ | ||
using System; | ||
using System.Collections.Generic; | ||
using Google.Protobuf; | ||
|
||
namespace Gauge.CSharp.Core | ||
{ | ||
public abstract class AbstractGaugeConnection : IDisposable | ||
{ | ||
protected readonly ITcpClientWrapper TcpClientWrapper; | ||
|
||
protected AbstractGaugeConnection(ITcpClientWrapper tcpClientWrapper) | ||
{ | ||
TcpClientWrapper = tcpClientWrapper; | ||
} | ||
|
||
public bool Connected => TcpClientWrapper.Connected; | ||
|
||
public void Dispose() | ||
{ | ||
TcpClientWrapper.Close(); | ||
} | ||
|
||
public void WriteMessage(IMessage request) | ||
{ | ||
var bytes = request.ToByteArray(); | ||
var cos = new CodedOutputStream(TcpClientWrapper.GetStream()); | ||
cos.WriteUInt64((ulong) bytes.Length); | ||
cos.Flush(); | ||
TcpClientWrapper.GetStream().Write(bytes, 0, bytes.Length); | ||
TcpClientWrapper.GetStream().Flush(); | ||
} | ||
|
||
public IEnumerable<byte> ReadBytes() | ||
{ | ||
var networkStream = TcpClientWrapper.GetStream(); | ||
var codedInputStream = new CodedInputStream(networkStream); | ||
return codedInputStream.ReadBytes(); | ||
} | ||
|
||
protected static long GenerateMessageId() | ||
{ | ||
return DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; | ||
} | ||
} | ||
} |
Oops, something went wrong.