We're working on a small docker image container for windows to run a specflow test in a dotnet core projecct. The problem we have is that we can't get chromedriver to work as well as running the dotnet test command.
The specflow project we're running just contains one hello world testcase which we can run without chromedriver, but then we get the error message "OpenQA.Selenium.DriverServiceNotFoundException : The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable."
We're providing an instance of chromedriver in the project so we don't have to download it.
The dockerfile we're running:
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /src
COPY . .
ENV PATH="/src/chromedriver:$PATH"
RUN dotnet test
We're using this command to run it: docker build . --build-arg HTTP_PROXY=http://PROXY:8080 --build-arg HTTPS_PROXY=http://PROXY:8080 --rm
We expect the specflow tests to run with chromedriver. When we run the dockerfile we get the error message "'dotnet' is not recognized as an internal or external command, operable program or batch file." It seems that the chromedriver is not added correctly to the PATH variable. We need it there to be able to run the specflow tests.
Does anybody know how to configure the dockerfile to work correctly with chromedriver?
Thanks for your time.
Related
I'm quite new to gitlab CI and have setup my server at DigitalOcean with gitlab-runnner. When I start the gitlab-runner by the command sudo gitlab-runner start, it runs fine and I confirm it with gitlab-runner status. But, the job fails immediately as per this screenshot
However, when I run gitlab-runner --debug run, the job runs perfectly fine.
I want to run gitlab-runner as a background service but its not running my jobs.
I found a solution to this issue from gitlab. For me, the solution was to comment out the clear console command from .bash_logout file in the gitlab-runner home folder.
More information about this issue can be taken from a bug logged at gitlab.
https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4449
I am using cypress testing server.
When I am running my tests with cypress window, its working right.
$./node_modules/.bin/cypress open --project tests/e2e/
But when I am trying to run it with command line, my tests didn't worked.
In screenshots I see, that my link doesn't loading and my page is empty and my tests result is false.
I am running with selected command
$ ./node_modules/.bin/cypress run --config pageLoadTimeout=10000,watchForFileChanges=false --project tests/e2e/
How I can run my tests with command line
First you should navigate to your project folder, for example if your cypress test is lying in below folder
C:/Project/
From the command prompt you should cd to the project folder, ie cd C:/Project/, now copy the cypress bin path as follows C:\Project\node_modules\.bin\ paste the path and then from there run the following command:
cypress run C:\Project\cypress\integration\examples\test-spec.js
note: This is tested and run in windows 10 environment
I have installed the latest version of Newman (3.10.0) in my 64-Bit Win 10 Machine.
C:\Users\ABC>npm install -g newman
C:\Users\ABC\AppData\Roaming\npm\newman -> C:\Users\ABC\AppData\Roaming\npm\node_modules\newman\bin\newman.js
+ newman#3.10.0
added 195 packages in 57.852s
However, I am not able to use the newman and I am getting below error while accessing.
C:\Users\ABC>newman -h
'newman' is not recognized as an internal or external command,
operable program or batch file.
I have added an environment variable for the NODE_PATH pointing to the newman directory C:\Users\ABC\AppData\Roaming\npm\node_modules\newman
but no luck. Could some one please help.
Adding in the Path variable under Environment Variable solve the problem even if we don't add in NODE_PATH
C:\Users\ yourusername \AppData\Roaming\npm
After doing this reopen command prompt
The issue was fixed after troubleshooting with the Node Application. A previous version of Node (32-bit) was installed in my machine and it was not completely removed after I did an uninstall. When I installed Node 64-Bit both entry was present in the environment variable and caused a conflict.
When I manually deleted both installation folder and the env variable the newman worked correcly.
I have installed node, vc redist and newman once (on clear windows 7 64 bit) and the issue is looks like related to wrong newman installation. Both newman and node should be installed from administrator session (not just with admin privileges). I have installed newman from regular user, system path setting are correct, but user environment was not set:
path=C:\Users\gagarin\AppData\Roaming\npm
So I have copied
C:\Users\<regular_user>\AppData\Roaming\npm
to C:\Users\admin\AppData\Roaming\npm and run C:\Users\admin\AppData\Roaming\npm\newman.cmd from administrator session. After that newman command became work in admin session. Sadly it works in regular user session only if I type full path to newman like
Blockquote
c:> C:\Users\admin\AppData\Roaming\npm\newman run ....
I was also getting the same error and I have followed the below steps to troubleshoot it-
1. Know what user is running jenkins, a simple way is Create a jenkins job and in its Build section run the command
whoami
2. If it shows System user, then do the following-
2.a. Set C:\Users\I823285\AppData\Roaming\npm and C:\Users\I823285\AppData\Roaming\npm\node_modules\newman\bin in SYSTEM ENV. VARIABLES.
b. Restart Jenkins by running CMD as ADMIN, and go to Jenkins installation folder, then enter jenkins.exe restart.
c. Re-build the project
SUCCESSFUL!
Does the build have to run on the drone.io server? Can I run the build locally? Since developers need to pass the build first before pushing code to github, I am looking for a way to run the build on developer local machine. Below is my .drone.yml file:
pipeline:
build:
image: node:latest
commands:
- npm install
- npm test
- npm run eslint
integration:
image: mongo-test
commands:
- mvn test
It includes two docker containers. How to run the build against this file in drone? I looked at the drone cli but it doesn't work in my expected way.
#BradRydzewski comment is the right answer.
To run builds locally you use drone exec. You can check the docs.
Extending on his answer, you must execute the command in the root of your local repo, exactly where your .drone.yml file is. If your build relies on secrets, you need to feed these secrets through the command line using the --secret or --secrets-file option.
When running a local build, there is no cloning step. Drone will use your local git workspace and mount it in the step containers. So, if you checkout some other commit/branch/whatever during the execution of the local build, you will mess things up because Drone will see those changes. So don't update you local repo while the build is running.
I need to start jenkins build job from Intellij, from terminal it works:
sudo java -jar jenkins-cli.jar -s http://localhost:8080/ build job-x/master -s -v
Intellij allows to create jar build configuration, but it doesn't allow to run jar files with administrator rights. So is there way to create build configuration in Intellij which runs jenkins-cli.jar?
Initial problem: need to run and debug jenkins pipeline script.