Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant get fitsharp working on linux #163

Closed
sgtobin opened this issue Sep 18, 2019 · 5 comments
Closed

Cant get fitsharp working on linux #163

sgtobin opened this issue Sep 18, 2019 · 5 comments

Comments

@sgtobin
Copy link

sgtobin commented Sep 18, 2019

Using this Suite.config file

<?xml version="1.0" encoding="utf-8"?>
<suiteConfig>
    <ApplicationUnderTest>
        <AddAssembly>AcceptanceTests.dll</AddAssembly>
        <AddNamespace>Acceptance.Tests</AddNamespace>
    </ApplicationUnderTest>
    <Settings>
        <Runner>fitnesse.fitserver.FitServer</Runner>
    </Settings>
</suiteConfig>

Using the following docker file...

FROM mcr.microsoft.com/dotnet/core/sdk:2.2

RUN apt-get update -qq && \
    apt-get install -y nano unzip wget openssl ca-certificates
	
RUN apt-get install -y openjdk-8-jdk

ENV FITNESSE_RELEASE 20190716

RUN	adduser --disabled-login -u 666 fitnesse && \
	mkdir /opt/fitnesse && \
	chown fitnesse.fitnesse /opt/fitnesse

RUN curl -fsSL -o /usr/local/lib/fitnesse-standalone.jar "http://www.fitnesse.org/fitnesse-standalone.jar?responder=releaseDownload&release=$FITNESSE_RELEASE"

COPY fit.dll /opt/fitnesse/
COPY fitSharp.dll /opt/fitnesse/
COPY Runner.dll /opt/fitnesse/
COPY Runner.runtimeconfig.json /opt/fitnesse/
COPY Suite.config /opt/fitnesse/
COPY AcceptanceTests.dll /opt/fitnesse/

WORKDIR /opt/fitnesse
VOLUME /opt/fitnesse
USER fitnesse
ENTRYPOINT ["java", "-Xmx256m", "-jar", "/usr/local/lib/fitnesse-standalone.jar", "-p", "8080"]
EXPOSE 8080

Run the container from powershell

docker build -t fitnesse .
docker run --rm -d --name fitnesse -p 8080:8080 -v $PWD/data:/opt/fitnesse fitnesse:latest

Create the following test...

!contents -R2 -g -p -f -h
!path /opt/fitnesse/AcceptanceTests.dll
!define COMMAND_PATTERN {%m /opt/fitnesse/Runner.dll -c /opt/fitnesse/Suite.config %p}
!define TEST_RUNNER {dotnet}
!|AcceptanceTests.MyAcceptanceTests|
|FirstString|SecondString|Concatenate?|
|Hello      |World       |Hello World |
|Steve      |Fenton      |Steve Fenton|

Get the following error...

fit:dotnet
Test page:	AcceptanceTests
Command:	dotnet /opt/fitnesse/Runner.dll -c /opt/fitnesse/Suite.config defaultPath d4f8b1899512 35869 3863
Exit code:	1
Time elapsed:	1 seconds
Standard Error:
No executable found matching command "dotnet-/opt/fitnesse/Runner.dll"
Internal Exceptions:
FitClient external process terminated before a connection could be established
FitClient external process terminated before a connection could be established

@essenius
Copy link

Have you tried removing the %p from the command pattern? That seems to introduce defaultPath in the command, which might mess things up.

@jediwhale
Copy link
Owner

I haven't tried fitnesse on linux yet but I was able to run fitSharp from terminal:
e.g.
dotnet ~/.nuget/packages/fitsharp/2.7.1.1/lib/netcoreapp3.1/Runner.dll -c sample.config.xml
where sample.config.xml is:

<suiteConfig>
    <ApplicationUnderTest>
        <AddAssembly>./bin/Debug/netcoreapp3.1/SampleSUT.dll</AddAssembly>
        <AddNamespace>SampleSUT</AddNamespace>
    </ApplicationUnderTest>
    <Settings>
        <InputFolder>./tests/in</InputFolder>
        <OutputFolder>./tests/out</OutputFolder>
        <Runner>fit.Runner.FolderRunner</Runner>
    </Settings>
</suiteConfig>

@pb1981
Copy link

pb1981 commented Apr 20, 2020

As long as you have mono and java installed, fitnesse works fine in Linux as well. I have run Testcases in Ubuntu using Chrome Browser(with out using docker image of fitnesse).

Start the TestServer: ./launchTestCaseServer.sh which includes
java -jar fitnesse-standalone.jar -p 9091 -e 0

For Running Runner executable:
mono ./Runner.exe -c SUT.config.xml 9999 where SUT.config.xml has below:

SUT_config

TestSuite should have below global variables defined:
!define SLIM_HOST {127.0.0.1} -> IP of Machine where Runner is running
!define SLIM_PORT {9999}
!define SLIM_POOL_SIZE {1}
!define SLIM_VERSION {0.0}
!define TEST_SYSTEM {slim}
!define MANUALLY_START_TEST_RUNNER_ON_DEBUG {true}
!define FILTER_TOC {true}

@pb1981
Copy link

pb1981 commented May 24, 2020

@sgtobin Is your problem solved for Linux Setup ? or you are still facing same issue or some different issue?

@jediwhale
Copy link
Owner

Tested successfully with netcore 3.1 and net 5.0 on linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants