Run Pytest on Glue - pytest

How do I invoke pytest on aws glue ? something like below
python -m pytest -m reg -ra --myxml=./myout.xml
I couldn't find much info on how to pass these markers while invoking pytest. Only option I see on aws glue is to pass .py file. I am also able to pass double hyphen parameter myxml but not sure for single hyphen one like -m and -ra. I tried using python shell as well as Spark.

pytest -rA -m reg --myxml=./myout.xml

Related

Is there any way to make pytest more silent? [duplicate]

I am currently learning pytest and going through the documentation it is not clear what "quiet" mode is and what the reason for using it is. Can anyone clarify this to me?
In the documentation I see it is denoted with -q like such:
$ pytest -q test_sysexit.py
But what does this do?
Adding -q option will make pytest to be more concise in its output to the console.
There are more options similar to it:
-qq will make pytest output even less information than -q.
-v to output more information than the default amount.
Source: run pytest --help in shell:
-v, --verbose increase verbosity.
-q, --quiet decrease verbosity.

How to prevent pytest from capturing log messages when -m flag is used

I am using pytest -s for displaying log messages to the console. It works fine for individual pytest. But when used with pytest -s -m option, it does not work.
pytest -s -m sdk
does not output to console. How do I get it to work?

MATLAB compilation

I'm try to compile a matlab project on RHEL 7.6,
Whene I try to run the follow command:
mcc -m SliceViewerMain.m -a <PATH>/*.fig -a <PATH>/*.bmp -a <PATH>/*.m
I get this error:
Error: You specified the file "<PATH>/pause_e.bmp" without using the "-a" option.
Is anyone know why I get that?
You don't specify, but I suspect you're using mcc at the shell command-prompt, rather than in MATLAB? In which case, the shell is expanding the * wildcard before mcc gets to see it, so it's as if you said:
$ mcc ... -a <PATH>/pause_a.bmp <PATH>/pause_b.bmp <PATH>/pause_c.bmp ...
The fix is either run the command inside MATLAB, or hide the wildcard expansion from the shell and let mcc expand by doing
$ mcc ... -a '<PATH>/*.fig' ...
I.e. use single quotes.

Mongo --ssl on bash script

I'm writing a bash script where it connects to the mongodb in different ways and I'll run this script on various projects - some of them require --ssl connection and some of them don't. So, I wanted to know a way for me to maybe declare a variable on top which will turn on or off depending on whether the project needs --ssl connection.
ssl="--ssl" #how do I determine whether to turn this variable on or off depending on whether the project needs --ssl?
Example of where its used in bash script
`master_var=`mongo ${ssl_mode} --eval "db.isMaster.ismaster"`
Another example in the bash script where I connect to mongo:
mongo --quiet ${ssl_mode} ${name_db} <<EOF
#some commands
EOF
Edit: I want all of this to be done on the bash script itself.
You can use environment variables:
if [ -n "$MYSCRIPT_ENABLE_SSL" ]; then
ssl_mode="--ssl"
fi
And from where you call the script:
MYSCRIPT_ENABLE_SSL=1 ./myscript.sh
or
export MYSCRIPT_ENABLE_SSL=1
./myscript.sh

Using multiple --properties arguments via JBoss CLI

I would like to know, if is possible to run following command (or something like this) with more than one properties file in --properties argument.
$JBOSS_HOME/bin/jboss-cli.sh --connect --user=admin --password=admin --properties=init.properties --properties=jvm.properties --file=init.cli
or
$JBOSS_HOME/bin/jboss-cli.sh --connect --user=admin --password=admin --properties=init.properties jvm.properties --file=init.cli
Yes, you can! You were actually right in your first given example.
Here's a non-practical illustration:
hello.properties
hello=Hello from the
world.properties
world='Second' property file
echo.cli
set hello=${hello}
set world=${world}
echo $hello $world
Running:
$ $JBOSS_HOME/bin/jboss-cli.sh --connect --properties=hello.properties --properties=world.properties --file=echo.cli
Hello from the 'Second' property file