Print statements that i added in my python code is not shown in allure report - allure

Print statements in my step-feature file are not shown in allure report. I'm using behave -f allure_behave.formatter:AllureFormatter -o reports ./features --no-capture.
python version - 3.11.0
allure-behave - 2.12
I'm using behave -f allure_behave.formatter:AllureFormatter -o reports ./features --no-capture.

Related

Selenium Pytest - Unrecognized argument html report

I created some test scripts using selenium python and they have been working okay. However, I have had trouble when I tried to generate an html report or an allure report.
I used the following command to try to generate a pytest html report: "pipenv run python -m pytest xxx/test_xxxx.py --html=report.html". However, I got the following error: "
ERROR: usage: __main__.py [options] [file_or_dir] [file_or_dir] [...]
__main__.py: error: unrecognized arguments: --html=report.html
inifile: None
rootdir: C:\Users\xxxx\xxxx"
. I had installed the pytest-html plugin using pip install pytest-html, so I am not sure what I have been doing wrong.
I tried uninstalling and reinstalling, but that did not work. I also tried the following links (among others):
pytest: error: unrecognized arguments: --html=report.html
generate html and json reports for selenium python automation test using pytest
Does anyone have any insight?
I think I have found the solution. Since I am using pipenv to run my tests, I would have to install the dependencies through pipenv as well. So for the html and allure reports, the full commands would be as follows:
pipenv run pip install allure-pytest
pipenv run pip install pytest-html
After trying this, I ran my previous commands and I no longer got the issue.

SnowSQL connection test fails with "No module named 'win32timezone'"

I've just installed SnowSQL for Windows as per the instructions at https://docs.snowflake.com/en/user-guide/snowsql-install-config.html#installing-snowsql-on-microsoft-windows-using-the-installer
However, when I attempt to connect to Snowflake, it fails:
C:\>snowsql -a <account> -u <user> --authenticator externalbrowser -o log_level=DEBUG
No module named 'win32timezone'
If the error message is unclear, enable logging using -o log_level=DEBUG and see the log to find out the cause. Contact support for further help.
Goodbye!
C:\>snowsql -v
Version: 1.2.7
Any ideas appreciated
What version of windows are you using? How did you install?
No module named 'win32timezone'
Per the official documentation snowsql is a python application. The error message above is a python error indicating it cannot find the aforementioned package. However, installing that package is not likely a fix as snowsql appears to ship with a version of python. Which makes a lot of sense, dealing with python dependencies is a nightmare.
I started a Windows 2016 host in AWS and installed snowsql 1.2.7 via the MSI. I was able to get to the login screen without any problems.
I would completely remove snowsql, do a search for snowsql and delete any folders you find, then reinstall. If it's still not working I'd provide more information as requested above.
This was acknowledged as a defect by Snowflake, and they will fix it in a newer version. The workaround is to install v 1.2.5, and invoke this version from the command line
snowflake <options> -v 1.2.5

go code coverage report in Jenkins with cobertura plugin

I have installed cobertura plugin in Jenkins and ran unit tests with below command #go test -cover -p 1 $PKGS | go-junit-report > report.xml. I could see report.xml is created with code coverage but I see below error in Jenkins console. Could you please let us know what is the issue and how to resolve this.
/bin/sh -xe /tmp/hudson1811800402022775798.sh
[Cobertura] Publishing Cobertura coverage report...
FATAL: Unable to find coverage results
java.io.IOException: <workspace>/report.xml is not a cobertura coverage report, please check your report pattern
at hudson.plugins.cobertura.CoberturaPublisher$ParseReportCallable.invoke(CoberturaPublisher.java:566)
at hudson.plugins.cobertura.CoberturaPublisher$ParseReportCallable.invoke(CoberturaPublisher.java:536)
at hudson.FilePath.act(FilePath.java:1018)
at hudson.FilePath.act(FilePath.java:996)
at hudson.plugins.cobertura.CoberturaPublisher.perform(CoberturaPublisher.java:343)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
[Cobertura] No coverage results were found using the pattern '**/report.xml' relative to '<some directory>'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cobertura?
Build step 'Publish Cobertura Coverage Report' changed build result to FAILURE
Finished: FAILURE
I have followed below steps to generate coverage report (for go language)
gocovxml
Install gocov xml using below commands
$ go get github.com/axw/gocov/...
$ go get github.com/AlekSi/gocov-xml
execute go test command if you have multiple packages
gocov test $PKGS -p 1 | gocov-xml > report.xml
Provide report.xml in publish cobertura coverage report (Post build action in Jenkins)
**/report.xml

How to visualize code coverage information on Go GAE apps?

I am developing a server with the latest Go GAE SDK. I am running tests after every change:
goapp test -test.v=true
I am using -cover to record coverage as described by goapp help testflag:
goapp test -cover -test.v=true -test.coverprofile=c.out
[..]
coverage: 53.8% of statements
ok _/var/lib/jenkins/jobs/loyalty/workspace 30.464s
This completes successfully and prints the percentage of lines covered by tests. However, attempting to visualize the results fails:
goapp tool cover -html=c.out
cover: can't find "app.go": cannot find package "_/home/ingo/git/loyalty/" in any of:
/home/ingo/Downloads/go_appengine_sdk_linux_amd64-1.9.10/go_appengine/goroot/src/pkg/_/home/ingo/git/loyalty (from $GOROOT)
/home/ingo/git/loyalty/src/_/home/ingo/git/loyalty (from $GOPATH)
Does Go's cover tool only work on non-GAE apps? Do I have to package my app differently in order to visualize the coverage results?
I unsuccessfully asked this on golang-nuts before.
There is an open issue related to it. As a temporary workaround, I am running sed in between collecting and visualizing the coverage results.
goapp test -cover -test.v=true -test.coverprofile=c.out
sed -i -e "s#.*/\(.*\.go\)#\./\\1#" c.out
goapp tool cover -html c.out -o coverage.html

How to configure and run nginx-gridfs

I am trying to run nginx-gridfs from github to connect mongodb with nginx . I followed the exact procedure as shown in the https://github.com/mdirolf/nginx-gridfs README file .
I compiled and make nginx in my system.by following step
$ ./configure --add-module=/path/to/nginx-gridfs/source/
$ make
$ make install
Now what to do next
I am unable to understand how to impliment Configuration Directives part in in README file .
Now the nginx-gridfs has ngx_http_gridfs_module.c .Do I have to compile it and run it in order to see the response .I compiled and make mongo c drivers and run the example.c it ran well .
Do somebody guide me or give me some good links which explains step by step configuration of nginx-gridfs .
My final aim is to link nginx+mongodb+C code ..
please help me ...

Resources