Closed jspenc72 closed 5 years ago
Hi @jspenc72 - I had to modify your Dockerfile
slightly, since it assumes your test code directory in it.
Here's what I did:
FROM centos:7
WORKDIR /gauge
USER root
RUN yum install -y unzip wget
RUN \
wget -O /tmp/gauge.zip `curl -s https://api.github.com/repos/getgauge/gauge/releases | grep browser_download_url | grep 'linux.x86_64.zip' | head -n 1 | cut -d '"' -f 4` && \
unzip -d /tmp/gauge /tmp/gauge.zip
RUN ls -la /tmp/
RUN ls -la /tmp/gauge
RUN ls -la /tmp/gauge/gauge
RUN \
cp /tmp/gauge/gauge /usr/local/bin/ && \
# http://www.mono-project.com/download/#download-lin-centos
yum install yum-utils
RUN \
rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" && \
yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/
RUN \
yum install -y mono-devel
RUN \
yum remove -y yum-utils && \
yum clean all && \
rm -rf gauge gauge.zip ~/.gauge/config ~/.gauge/logs &&\
chmod 777 /gauge
RUN \
yum install -y nuget
ENV GAUGE_HOME=/gauge/plugins
ENV GAUGE_API_PORT=36267
ENV GAUGE_INTERNAL_PORT=36165
RUN env
# Install gauge plugins
RUN gauge install java && \
gauge install screenshot
RUN gauge install csharp
RUN gauge install html-report
RUN gauge install xml-report
RUN chmod 777 /gauge/plugins -R
CMD gauge init csharp && gauge run specs
and after docker build -t gauge-centos .
I ran docker run -t gauge-centos
. Here's the output:
create gauge
create gauge
create gauge
create Properties/AssemblyInfo.cs
create env/default/csharp.properties
create StepImplementation.cs
create packages.config
create gauge.csproj
create gauge.sln
Installing Nuget Package : FluentAssertions, version: 3.5.0
Installing Nuget Package : Gauge.CSharp.Lib, version: 0.7.2
Done Installing Nuget Package!
create manifest.json
create specs
create specs/example.spec
create .gitignore
create env
create env/default
create env/default/default.properties
Successfully initialized the project. Run specifications with "gauge run specs/".
Telemetry
---------
This installation of Gauge collects usage data in order to help us improve your experience.
The data is anonymous and doesn't include command-line arguments.
To turn this message off opt in or out by running 'gauge telemetry on' or 'gauge telemetry off'.
Read more about Gauge telemetry at https://gauge.org/telemetry
Building project: /gauge/gauge.csproj
/usr/bin/xbuild /gauge/gauge.csproj /t:Build /v:q /p:RestorePackages="False" /p:OutputPath="/gauge/gauge_bin" /p:Platform="Any CPU" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"/gauge/plugins/plugins/csharp/0.10.5/bin/FakeLib.dll"
>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0
Mono, Version 5.18.1.0
Copyright (C) 2005-2013 Various Mono authors
# Specification Heading
## Vowel counts in single word ✔ ✔
## Vowel counts in multiple word ✔ ✔
Successfully generated html-report to => /gauge/reports/html-report/index.html
Specifications: 1 executed 1 passed 0 failed 0 skipped
Scenarios: 2 executed 2 passed 0 failed 0 skipped
Total time taken: 1.832s
Telemetry
---------
This installation of Gauge collects usage data in order to help us improve your experience.
The data is anonymous and doesn't include command-line arguments.
To turn this message off opt in or out by running 'gauge telemetry on' or 'gauge telemetry off'.
Read more about Gauge telemetry at https://gauge.org/telemetry
For your case I suspect that your project somehow has a build error, it's indicated in your log by this line:
C# Project build failed Exception of type 'Fake.MSBuildHelper+BuildException' was thrown.
Could you try building your project in the container and check? for ex, you could /bin/bash
into your container instance and run gauge run specs
?
@sriv Ok so I was able to reproduce the behavior im getting with a newly created project by doing the following:
mkdir ./projectdir && cd ./projectdir
gauge init
gauge run specs
(Tests pass)
$ gauge run specs
Building project: /ngs-tests/NgsTests.csproj
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild /ngs-tests/NgsTests.csproj /t:Build /v:q /p:RestorePackages="False" /p:OutputPath="/ngs-tests/gauge_bin" /p:Platform="Any CPU" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"/.gauge/plugins/csharp/0.10.5/bin/FakeLib.dll"
Microsoft (R) Build Engine version 16.0.40-preview+ge6c3a1f9e4 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
Successfully generated html-report to => /ngs-tests/reports/html-report/index.html Specifications: 1 executed 1 passed 0 failed 0 skipped Scenarios: 2 executed 2 passed 0 failed 0 skipped
Total time taken: 273ms
This installation of Gauge collects usage data in order to help us improve your experience. The data is anonymous and doesn't include command-line arguments. To turn this message off opt in or out by running 'gauge telemetry on' or 'gauge telemetry off'.
Read more about Gauge telemetry at https://gauge.org/telemetry
4. `cd ../`
5. `mkdir ./otherdir`
6. `mv ./projectdir/* ./otherdir/ && cd ./otherdir`
7. `gauge run specs` (Tests fail, Plugin fails to start)
```bash
$ gauge run specs
Building project: /ngs-tests/NgsTests.csproj
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild /ngs-tests/NgsTests.csproj /t:Build /v:q /p:RestorePackages="False" /p:OutputPath="/ngs-tests/gauge_bin" /p:Platform="Any CPU" /p:Configuration="Debug" /logger:Fake.MsBuildLogger+ErrorLogger,"/.gauge/plugins/csharp/0.10.5/bin/FakeLib.dll"
Microsoft (R) Build Engine version 16.0.40-preview+ge6c3a1f9e4 for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1009: Project file does not exist.
Switch: /ngs-tests/NgsTests.csproj
Gauge.CSharp.Runner.GaugeProjectBuilder C# Project build failed Exception of type 'Fake.MSBuildHelper+BuildException' was thrown.
Error ----------------------------------
Failed to start gauge API: Timed out connecting to 127.0.0.1:60515
Get Support ----------------------------
Docs: https://docs.gauge.org
Bugs: https://github.com/getgauge/gauge/issues
Chat: https://gitter.im/getgauge/chat
Your Environment Information -----------
darwin, 1.0.4, 3a9a647
csharp (0.10.5), html-report (4.0.8), screenshot (0.0.1), xml-report (0.2.1)
@jspenc72 This issue is related to #154. The csharp.properties
file in env
dir contains a hardcoded path when you create the project When you move the project the path for project file changes and the gauge-csharp runner fails to find it.
This issue has been already fixed, we will be making a release soon with the fix.
Meanwhile, you can use the nightly version of gauge-csharp
runner( you can find it https://bintray.com/gauge/gauge-csharp).
Refer https://github.com/getgauge/gauge-csharp#nightly-installation to check the nightly install instructions.
If you do not want to use the nightly you can update the GAUGE_CSHARP_PROJECT_FILE property in env/csharp.properties
file to use the relative project after creating the project.
Thank you! It appears that there were two separate issues. The properties file May not be the same problem.
@jspenc72 I could not replicate your original issue with the updated Dockerfile by @sriv (After fixing the properties I was able to run the specs).
I don't see why an incorrect properties file caused the error message "Failed to start gauge API: Timed out connecting to 127.0.0.1:58435." Did it really time out connecting to that port? Was that the wrong port?
It is currently happening because the cSharp runner crashes as the project path is wrong and hence Gauge could not connect to it. Perhaps the error message can be more evident.
This issue has been verified and found fixed with the version 0.10.6.nightly-2019-05-16
Expected behavior
Tests should begin to execute.
Actual behavior
Tests failed to start and the following output is shown
Steps to reproduce
WORKDIR /gauge
USER root RUN yum install -y unzip
RUN \ wget -O /tmp/gauge.zip
curl -s https://api.github.com/repos/getgauge/gauge/releases | grep browser_download_url | grep 'linux.x86_64.zip' | head -n 1 | cut -d '"' -f 4
&& \ unzip -d /tmp/gauge /tmp/gauge.zip RUN ls -la /tmp/ RUN ls -la /tmp/gauge RUN ls -la /tmp/gauge/gauge RUN \ cp /tmp/gauge/gauge /usr/local/bin/ && \http://www.mono-project.com/download/#download-lin-centos
yum install yum-utils
RUN \ rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" && \ yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/
RUN \ yum install -y mono-devel
RUN \ yum remove -y yum-utils && \ yum clean all && \ rm -rf gauge gauge.zip ~/.gauge/config ~/.gauge/logs &&\ chmod 777 /gauge
RUN \ yum install -y nuget
ENV GAUGE_HOME=/gauge/plugins ENV GAUGE_API_PORT=36267 ENV GAUGE_INTERNAL_PORT=36165
RUN env
Install gauge plugins
RUN gauge install java && \ gauge install screenshot RUN gauge install csharp RUN gauge install html-report RUN gauge install xml-report
RUN chmod 777 /gauge/plugins -R
Add test framework source code
COPY . /ngs/testing WORKDIR /ngs/testing
RUN ls -la
Install nuget dependencies
RUN nuget update -self RUN nuget restore -MSBuildVersion 14
RUN gauge run specs/ReactVariantTable.spec
ENV PATH=$HOME/.gauge:$PATH
Gauge version
Project Recent Gauge Log Output