I'm using below command in my terminal.(Im following the cypress support doc)
cypress run --env host=kevin.dev.local,api_server=http://localhost:8888/api/v1
my spec is like this.
I'm expecting to set variables as below:
host=kevin.dev.local
api_server=http://localhost:8888/api/v1
But it does not set the value of the "api_server". Instead it sets host with both values as below:
host=kevin.dev.local http://localhost:8888/api/v1
Pls support to get this resolved.
You shell might interpret some of the characters before passing them to Cypress.
When I run in Powershell the following command:
> cypress open --env a=1,b=2
I'll end up in the same situation like described.
When I run:
> cypress open --env "a=1,b=2"
It will correctly set two env variables a and b with correct values.
So, try using double quotes.
Related
I have curl that i use in gitlab-ci job to upload an artifact to Nexus
the command is as follow (defined in .gitlab-ci.yml under script section)
cmd /c curl -v -u $env:USERREG:$env:PASSREG --upload-file $env:BINFILE $env:NEXUS_REGISTRY/$env:REPONAME$env:BINFILE
of course all the variables are declared in .gitlab-ci.yml file except for USERREG and PASSREG which i declared them using the gitlab GUI.
Notice that i am using:
- Gitlab Runner with docker-windows executor
- Windows docker container to exec the above command
PROBLEM : the job is stacked demanding for the user (defined by USERREG) password (PASSREG) until the job is terminated due to timeout.
How to fix this problem ? thank you.
I am not sure if this could be your problem, but please check and refer to the GitLab Variables which you set ( USERREG and PASSREG). If they are protected variables that means that they will be only available on a "protected" branches and in case you are pushing it from non-protected branch that could brings you to the state where you are currently because above mentioned variables are not available.
If this is the case, just make them to not be protected but masked and you should be fine.
I want to use ctest from the command line to run my tests with memcheck and pass in arguments for the memcheck command.
I can run ctest -R my_test to run my test, and I can even run ctest -R my_test -T memcheck to run it through memcheck.
But I can't seem to find a way to pass arguments to that memcheck command, like --leak-check=full or --suppressions=/path/to/file.
After reading ctest's documentation I've tried using the -D option with CTEST_MEMCHECK_COMMAND_OPTIONS and MEMCHECK_COMMAND_OPTIONS. I also tried setting these as environment variables. None of my attempts produced any different test command. It's always:
Memory check command: /path/to/valgrind "--log-file=/path/to/build/Testing/Temporary/MemoryChecker.7.log" "-q" "--tool=memcheck" "--leak-check=yes" "--show-reachable=yes" "--num-callers=50"
How can I control the memcheck command from the ctest command line?
TL;DR
ctest --overwrite MemoryCheckCommandOptions="--leak-check=full --error-exitcode=100" \
--overwrite MemoryCheckSuppressionFile=/path/to/valgrind.suppressions \
-T memcheck
Explanation
I finally found the right way to override such variables, but unfortunately it's not easy to understand this from the documentation.
So, to help the next poor soul that needs to deal with this, here is my understanding of the various ways to set options for memcheck.
In a CTestConfig.cmake in you top-level source dir, or in a CMakeLists.txt (before calling include(CTest)), you can set MEMORYCHECK_COMMAND_OPTIONS or MEMORYCHECK_SUPPRESSIONS_FILE.
When you include(CTest), CMake will generate a DartConfiguration.tcl in your build directory and setting the aforementioned variables will populate MemoryCheckCommandOptions and MemoryCheckSuppressionFile respectively in this file.
This is the file that ctest parses in your build directory to populate its internal variables for running the memcheck step.
So, if you'd like to set you project's options for memcheck during cmake configuration, this is the way to got.
If instead you'd like to modify these options after you already have a properly configured build directory, you can:
Modify the DartConfiguration.tcl directly, but note that this will be overwritten if cmake runs again, since this file is regenerated each time cmake runs.
Use the ctest --overwrite command-line option to set these memcheck options just for that run.
Notes
I've seen mentions online of a CMAKE_MEMORYCHECK_COMMAND_OPTIONS variable. I have no idea what this variable is and I don't think cmake is aware of it in any way.
Setting CTEST_MEMORYCHECK_COMMAND_OPTIONS (the variable that is actually documented in the cmake docs) in your CTestConfig.cmake or CMakeLists.txt has no effect. It seems this variable only works in "CTest Client Scripts", which I have never used.
Unfortunately, both MEMORYCHECK_COMMAND_OPTIONS and MEMORYCHECK_SUPPRESSIONS_FILE aren't documented explicitly in cmake, only indirectly, in ctest documentation and the Testing With CTest tutorial.
When ctest is run in the build, it parses the file to populate its internal variables:
https://cmake.org/cmake/help/latest/manual/ctest.1.html#dashboard-client-via-ctest-command-line
It's not clear to me how this interacts with
Does anybody know how I can run gauge with a custom argument to command line and handle it in python plugin?
For example:
When I launch gauge, I want also pass additional argument/flag to command line (> gauge run specs 17) and then handle it and use in my python code before/or when suites starts
Solution was found.
I just added session enviroment variable.
https://github.com/getgauge/docs.gauge.org/blob/master/configuration.rst
You can add a property to env/default/default.properties and use that property as an argument.
E.g. gauge run --env ci specs
Reference: https://docs.gauge.org/latest/configuration.html#id1
My question is similar to this: Execute only one talend component. Except instead of using the Talend Open Studio, I want to be able to run a specific component from the shell executable I get from building the job.
I have set up my job in a way that if a component is succeeded, the OnComponentOk trigger is used to run the next component. To run the job I run sudo bash NAME_OF_THE_JOB.sh. Is it possible to run only one component, perhaps by passing arguments to the bash shell file?
A Talend job is a single java program. Components are translated to java functions. There are no arguments that allow you to execute a single component.
What you could do is write your job in such a way to execute a component whose name is passed via a context variable but it's not pretty.
You can test the component name passed via a variable named componentName using Run If triggers:
tRunJob_1
/
if("tRunJob_1".equals(context.componentName)
/
/
Start ---if("tJava_2".equals(context.componentName))-- tJava_2
\
\
if("tRest_1".equals(context.componentName))
\
tRest_1
As you can see, this can get very cumbersome, and requires you to know the component's name in order to run it.
You can then launch your job by passing the component name as argument :
sudo bash NAME_OF_THE_JOB.sh --context_param componentName=tJava_2
I am currently attempting to launch a different console (.exe) and pass multiple commands; while starting and entering a command works just fine, I haven't been able to find out how multiple ones can be entered via powershell.
& "C:\Program Files\Docker Toolbox\start.sh" docker-compose up -d --build
The given command works fine, but as mentioned I need to pass more than one command - I tried using arrays, ScriptBlocks and different sequences, though to no avail.
Edit:
Noticed that the docker build has a -f tag which allows me to specify a file; however, the issue now seems to be that the executed cmd removes all backslashes & special characters, rendering the path given useless.
Example:
&"C:\Program Files\Docker Toolbox\start.sh" 'docker-compose build -f
path\to\dockerfile'
will result in an error stating that "pathtodockerfile" is an invalid path.
Your start.sh needs to be able to handle multiple arguments. This doesn't look like a PowerShell question
Turns out that it was easier than expected; Solved it by executing a seperate file that contained the two commands needed and passing it to the start.sh file.
&"C:\Program Files\Docker Toolbox\start.sh" './xyz/fileContainingCommands.sh'