I am working on creating a docker image for running jmeter tests with plugins, but I am stuck at point where the jmeter plugin manager wont install. I tried most of things on the internet but with no luck.
I tried using existing docker images on the hub but everything fails on finding the class for pluginmanager.
Below is the error I get:
Step 16/23 : RUN cd $JMETER_HOME && java -cp /lib/ext/jmeter-plugins-manager-1.4.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
---> Running in d2d5579a4832
Error: Could not find or load main class org.jmeterplugins.repository.PluginManagerCMDInstaller
The command '/bin/sh -c cd $JMETER_HOME && java -cp /lib/ext/jmeter-plugins-manager-1.4.jar org.jmeterplugins.repository.PluginManagerCMDInstaller' returned a non-zero code: 1
Could not find or load main class org.jmeterplugins.repository.PluginManagerCMDInstaller
it means that your CLASSPATH doesn't contain PluginManagerCMDInstaller class.
My expectation is that you need to remove the slash before /lib as in Linux paths which start from slash are considered absolute and most probably you need to use the relative one:
RUN cd $JMETER_HOME && java -cp lib/ext/jmeter-plugins-manager-1.4.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
More information:
How to Install the JMeter Plugins Manager
Plugins Manager from Command-Line
Related
I am trying to run python test through jenkins. I have pytest framework.
I have also installed python 3.8 on jenkins slave machine and set path in the environment variables
I have added below path under PATH section of environment variable as below
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32\Scripts
C:\Users\Admin\AppData\Local\Programs\Python\Python38-32
But still I am getting below error on while running job.
Below are my windows batch command to run from Jenkins:
echo '#### Create Virtual Environment ####'
python -m venv .UIAutomation/venv
echo '#### Activate Virtual Environment ####'
echo '#### Run tests ####'
pytest -s -v --alluredir=.UIAutomation/reports ./UIAutomation/tests --env=staging --browser=chrome
Please help
More details about console error :
warning: manifest_maker: standard file '-c' not found
12:04:12 Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
Note:
Below is my first requirement from file
Collecting psycopg2==2.8.6 (from -r ./UIAutomation/requirements.txt
So after execution I am seeing below error at first line of console-
12:04:12 Error: pg_config executable not found.
12:04:12 pg_config is required to build psycopg2 from source. Please add the directory
From what I see, I find the batch call suspicious.
I think call launches a new console and returns to the script, if its done. So in your case, you activate your venv in another console and then use your standard python env, not the venv and there is no pytest dependency installed.
See also: https://ss64.com/nt/call.html
I had a similiar problem in a yaml script I wrote for Azure DevOps.
I did solve that, with creating the venv and then adding the venv path to the environment variables.
Goal
I am using Docker to run JMeter in Azure Devops. I am trying to use Blazemeter's Parallel Controller, which is not native to JMeter. So, according to the justb4/jmeter image documentation, I used the following command to get the image going and run the JMeter test:
docker run --name jmetertest -i -v /home/vsts/work/1/s/plugins:/plugins -v $ROOTPATH:/test -w /test justb4/jmeter ${#:2}
Error
However, it produces the following error while trying to accommodate for the plugin (I know the plugin makes the difference due to testing without the plugin):
cp: can't create '/test/lib/ext': No such file or directory
As far as I understand, this is an error produced when one of the parent directories of the directory you are trying to make does not exist. Is there something I am doing wrong, or is there actually something wrong with the image?
References
For reference, I will include links to the image documentation and the repository.
Image: https://hub.docker.com/r/justb4/jmeter
Repository: https://github.com/justb4/docker-jmeter
Looking into the Dockerfile:
ENV JMETER_HOME /opt/apache-jmeter-${JMETER_VERSION}
Looking into entrypoint.sh
if [ -d /plugins ]
then
for plugin in /plugins/*.jar; do
cp $plugin $(pwd)/lib/ext
done;
fi
It basically copies the plugins from /plugins folder (if it is present) to /lib/ext folder relative to current working directory
I don't know why did you add this stanza -w /test to your command line but it explicitly "tells" the container that local working directory is /test, not /opt/apache-jmeter-xxxx, that's why the script is failing to copy the files.
In general I don't think that the approach is very valid because:
In Azure DevOps you won't have your "local" folder (unless you want to add plugins binaries under the version control system)
Some JMeter Plugins have other .jars as the dependencies so when you're installing the plugin you should:
put the plugin itself under /lib/ext folder of your JMeter installation
put the plugin dependencies under /lib folder of your JMeter installation
So I would recommend amending the Dockerfile, download JMeter Plugins Manager and installed the plugin(s) you need from the command line
Something like:
RUN wget https://jmeter-plugins.org/get/ -O /opt/apache-jmeter-${JMETER_VERSION}/lib/ext/jmeter-plugins-manager.jar
RUN wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar -P /opt/apache-jmeter-${JMETER_VERSION}/lib/
RUN java -cp /opt/apache-jmeter-${JMETER_VERSION}/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
RUN /opt/apache-jmeter-${JMETER_VERSION}/bin/./PluginsManagerCMD.sh install bzm-parallel
I am writing a few kong custom plugins in Lua. I am using Kong 2.3.3 and Lua 5.1.
I have some test cases (unit tests + integration tests) and i am running them with pongo run -coverage option. I have already installed luacov (and also cluacov, both with luarocks install) and all my tests are passing but no luacov files are being generated with coverage data. I am not running pongo from Docker, i have installed and configured it in my local machine (which is Linux Ubuntu 20.04).
I have already tried a few things as follows:
my .busted file is setting coverage = true, verbose = true and output = "gtest" (already tried utfTerminal, tap and json too)
tried adding luacov as a dependency to my rockspec file... the build does not fail but no coverage file is generated
i even tried running the tests without pongo, using busted directly but this is a very bad option because things like spec.helpers, or the cjson lib are not set in my LUAPATH
A quick way to do this is to modify pongo
Edit your pongo.sh file to:
add coverage flag to busted --coverage
call luacov to generate the report luacov
display the report cat luacov.report.out
locate where busted is called, line 959 for me:
"/bin/sh" "-c" "bin/busted --coverage --helper=bin/busted_helper.lua ${busted_params[*]} ${busted_files[*]};luacov;cat luacov.report.out"
Install luacov, edit assets/Dockerfile
after busted installation add luacov:
&& luarocks install busted-htest \
&& luarocks install luacov \
pongo run will give you
[...]
==============================================================================
Summary
==============================================================================
File Hits Missed Coverage
-------------------------------------------------------------------------------------------------------
/kong-plugin/kong/plugins/myplugin/schema.lua 105 1 99.06%
/kong-plugin/spec/myplugin/01-schema_spec.lua 199 5 97.55%
[...]
You can create a docker image based on pongo
spec/unit/docker/Dockerfile
FROM kong-pongo-test:2.3.2
USER root
RUN luarocks install luacov
WORKDIR /kong-plugin
COPY . .
spec/unit/docker/run.sh
#!/bin/sh
busted --coverage spec/unit
luacov
cat luacov.report.out
Run
docker build -f spec/unit/docker/Dockerfile -t my-coverage .
docker run my-coverage sh spec/unit/docker/run.sh
Pongo gained some support for this (still a PR). Note that it only covers unit tests, not integration ones.
See https://github.com/Kong/kong-pongo/pull/184
btw: the other anwers are too complex imo, you can add .pongo/pongo-setup.sh to install LuaCov, and move the .luacov file from /kong-plugin to /kong. That should be all that is necessary.
Running tests with coverage can be simply done by passing the flag, without any need to edit pongo or the dockerfile. Try pongo run -- --coverage for example.
Hey in Jenkins I'm trying to run robot framework tests:
with command python3 robot -d results mytestsuite.robot, and it has some line to open chrome browser, but the message in log shows me typical: WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see...
Everything works ok locally, and I'm not sure which PATH jenkins wants to use so my questions are:
why do I have to input python3 instead of python (with just python in command it tells me that robot is not found)
why chromedriver is not found, and how to set it up (in what PATH and how) to make it work
Is it possible to set jenkins up to use other drivers ex. geckodriver?
My jenkins job env looks like this:
#!/bin/bash
echo $JENKINS_HOME
which python3
echo $PATH
outputs:
/Users/MYUSER/.jenkins
/usr/bin/python3
/Users/MYUSER/.jenkins/tools/chromedriver:/usr/bin:/bin:/usr/sbin:/sbin
Ok so I've fixed it with:
export PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin/:$PATH
this is the location where I have chromedriver locally.
in the build shell execute but is there a way to make it more permanent (I mean not to use it every time it runs build?)
I am trying to create custom docker image for Alfresco 6.2, I already did the set-up for Alfresco 6.2 docker container and it's up and running fine.
Now I have to create custom docker image by adding/installing following amp files in the custom image.
alfresco-content-connector-for-salesforce-repo-2.1.x.amp
alfresco-content-connector-for-salesforce-share-2.1.x.amp
Can someone please share the exact steps to generate custom docker images?
I have following commands in my Fockerfile
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
ARG TOMCAT_DIR=/usr/local/tomcat \
ADD alfresco-content-connector-for-salesforce-repo-2.1.x.amp ${TOMCAT_DIR}/amps
RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \ ${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco --nobackup
And I am getting following error after executing command:-
docker build -t customacs/acs-platform .
05290000 An IO error was encountered during deployment of the AMP into the WAR
Any help will be appreciated.
Thanks in Advance
Use the root user to build the docker file.
Docker file for repo amp:
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
USER root
COPY ./amps/alfresco-content-connector-for-salesforce-repo-2.1.x.amp /usr/local/tomcat/amps/
RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps /usr/local/tomcat/webapps/alfresco -directory -nobackup -force \
&& chown -R root:Alfresco /usr/local/tomcat
USER alfresco
Docker file for share amp :
FROM alfresco/alfresco-share:6.2.0
COPY ./amps/alfresco-content-connector-for-salesforce-share-2.1.x.amp /usr/local/tomcat/amps_share/
RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force \
I have faced a similar issue but not the same.
Error Message: 08160000 An IO error was encountered during deployment of the AMP into the WAR
The most likely reason for this error is due to lack of permission to update the war or files in the webapp. You may run the MMT utility with the '-verbose' flag to find out what file/directory is being updated right before the exception is thrown. That resource is typically the reason for the error.
Share Connector is for Enterprise only. It looks like you are trying to install it on the Community Edition stack:
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
Cheers,
Eddie