Allure step inside Testit step - allure

step and testit.step, because customer wants to use both reports
I tried:
`
def step(desc):
testit.step(desc):
allure.step(desc)
`
But i have error for __enter__ method
I tried to insert allure.step inside testit, but it not works too. Help, please.
I wand to see steps in both reports

Related

Spark Streaming display (streaming) not working

I follow this example to simulate streaming in Spark from a source file. At the end of the example, a function named display is used which is supported only in databricks. I run my code in Jupyter notebook. What is the alternative in Jupyter to get the same output obtained from display function?
screenshoot_of_the_Example
Update_1:
The code:
# Source
sourceStream=spark.readStream.format("csv").\
option("header",True).\
schema(schema).option("ignoreLeadingWhiteSpace",True).\
option("mode","dropMalformed").\
option("maxFilesPerTrigger",1).load("D:/PHD Project/Paper_3/Tutorials/HeartTest_1/").\
withColumnRenamed("output","label")
#stream test data to the ML model
streamingHeart=pModel.transform(sourceStream).select('label')
I do the following:
streamingHeart.writeStream.outputMode("append").\
format("csv").option("path", "D:/PHD \
Project/Paper_3/Tutorials/sa1/").option("checkpointLocation",\
"checkpoint/filesink_checkpoint").start()\
The problem is that the generated files (output files) are empty. What might be the reason behind that?
I solved the problem by changing the checkpoint, as follow.
Project/Paper_3/Tutorials/sa1/").option("checkpointLocation",\
"checkpoint/filesink_checkpoint_1")

Gatling script compilation error saying value 'check' is not a member

I have a method in a gatling user-script as below.
This script was written in gatling 2.3.
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.check(wsAwait.within(30).until(1).regex("success").exists))
.exec(ping)
}
I am converting this in to gatling 3.0 and when I try to run it I get the following error.
value check is not a member of io.gatling.http.action.ws.WsSendTextFrameBuilder
I searched everywhere but I couldn't find a documentation related to WsSendTextFrameBuilder class to change the method call accordingly.
Does anyone know a documentation related to this class or a way to fix this issue?
Thank you.
After going through the documentation of Gatling 2.3 and 3.0 I found the new calls for the above scenario.
Apparently the check method is not available anymore in the WsSendTextFrameBuilder class.
Instead of that should use the await method.
So the code would look something similar to below.
val checkReply = ws.checkTextMessage("request").check(regex("request-complete"))
def registerAddress: ChainBuilder = {
exec(ws("WS Register Address").wsName(id)
.sendText(prefetchAddress)
.await(30 seconds)(checkReply))
.exec(ping)
}

Laravel DB::raw COPY

im using Laravel 5.5 and I have a very large file that i need to insert its content into the postgres database.
In my research i saw the COPY function from Postgresql documentation. Copy function documentation.
I tested the command below in the PgAdmin and works fine.
COPY requisitions FROM '/srv/www/billing_log' DELIMITER ',';
So i saw that in Laravel we can use something like DB::raw() to execute this commands in postgres. I try using the below code but nothing happens and its show no errors.
public function insertFile()
{
DB::raw("COPY requisitions FROM '/srv/www/billing_log' DELIMITER ','");
return 'OK';
}
The 'OK' is returned and my DB config is working fine on the others methods.
Could somebody help me?
DB::raw doesn't execute anything, it just returns an expression to use in the query builder.
You can use DB::statement() to execute a raw statement.
https://laravel.com/docs/5.6/database#running-queries

Getting error for dom.load() while running test class

I am using
1. DOM.Document doc = new DOM.Document();
2. doc.Load(httpResponse);
these lines in one apex class to convert XML body to document.
while executing this class normally it will show output nothing will happen at that time. But when I am executing same class in test class at line no 2 m getting below error
'System.XmlException: Failed to parse XML due to: only whitespace content allowed before start tag and not P (position: START_DOCUMENT seen P... #1:1)'
Can anyone please help in same problem?
Thanks in advance
Just remember callouts not work in test. So it seems your httpResponse is empty. You can either not run test on a callout block using Test.isRunningTest() or fake a response and use it when running test.

Django Models "IndexError: list index out of range" Pydev

I have a Django project in Eclipse PyDev.
I have a file views.py which has the line:
from models import ingredient2
In models.py I have:
from django.db import models
class ingredient2(models.Model):
ingredient = models.CharField(max_length=200)
When I try to run the app I get the following error:
File "C:\Python27\lib\site-packages\django\db\models\base.py", line 54, in __new__
kwargs = {"app_label": model_module.__name__.split('.')[-2]}
IndexError: list index out of range
I did sync the database and started the server running.
I went into base.py and added 2 print statements (yes, I probably should not edit Django's files):
if getattr(meta, 'app_label', None) is None:
# Figure out the app_label by looking one level up.
# For 'django.contrib.sites.models', this would be 'sites'.
model_module = sys.modules[new_class.__module__]
print model_module #ADDED
print model_module.__name__ #ADDED
kwargs = {"app_label": model_module.__name__.split('.')[-2]}
They print out:
<module 'models' from 'C:\Users\Tine\workspace\slangen\slangen2\bolig\models.pyc'>
models
manage.py is contained within the bolig folder. I think the correct app label would be "bolig". The app worked several months ago and now, when I come back to it, something is not right. I have been creating other projects in PyDev.
Add a meta class with an app_label inside your model class definition:
class Foo:
id = models.BigIntegerField(primary_key=True)
class Meta:
app_label = 'foo'
I had something similar
instead of
from models import ingredient2
try :
from your_app_name.models import ingredient2
Well, not really an answer, but... I ended up creating a new django project and then copying in my code. That fixed the problem.
I was also getting the kwargs = {"app_label": model_module.__name__.split('.')[-2]} error when using PyDev. In my case, the project wasn't refreshed before I tried to run it. As soon as I refreshed it, all was well again.
I ran into this problem using Eclipse, Django and PyDev. I needed to have the application (instead of some .py file for example) selected in the PyDev Package Explorer (left panel) before clicking Run for everything to work properly.
in my case, models.py contains models
when I import models to other .py, say views.py it doesn't raise error when I run views.py
but when I run models.py, it raise the same error.
so I will just don't run in the models.py

Resources