Skip test by default

233 views
Skip to first unread message

James Murphy

unread,
Mar 24, 2021, 6:14:03 AM3/24/21
to QATrack+

Hi
We have a daily QA testlist and one of the tests is to check the in room alarm once a week. We have a test called alarm which is multiple choice with a pass fail tolerance.
How do I set the test as skipped by default? I have tried UTILS.set_skip(alarm, True) from inside the test calculation procedure.
Thanks
James

Randle Taylor

unread,
Mar 24, 2021, 9:38:12 AM3/24/21
to James Murphy, QATrack+
In 0.3.0 you will have to use a different composite test to set the skip value. In 3.1 for non-calculated tests, the calculation procedure is used to set initial values so you can set the default value and skip setting using the calculation procedure like this:

alarm = None
UTILS.set_skip("alarm", True)

Hope that helps!

--
You received this message because you are subscribed to the Google Groups "QATrack+" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qatrack+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qatrack/34d0707f-50f8-4b38-95e2-8fe7bd37dc4cn%40googlegroups.com.

James Murphy

unread,
Mar 24, 2021, 2:09:05 PM3/24/21
to QATrack+
Hi
That's great, I had something similar but stupidly didn't put the macro name in quotes.
By the way 3.1 is great, have migrated most of our QA spreadsheets across and going through the formal testing and acceptance.
Thanks

Landon Clark

unread,
Apr 13, 2021, 5:23:48 PM4/13/21
to QATrack+
We too would like to automatically skip some tests, but only for those that have no previous result (some linacs that share testlists have different energies, and those tests have never been ran for that machine).  Would there be anything wrong with using it this way?  In this case, our test macro name is reading1_6mv.  Thanks!

from qatrack.qa.models import TestInstance

instances = TestInstance.objects.filter(
    unit_test_info__test_id=28,  # replace with your test_id,
    unit_test_info__unit__number=META[
        "unit_number"
    ],  # limit to results from current unit
    test_list_instance__work_completed__lte=META[
        "work_started"
    ],  # limit results to prior dates
    test_list_instance__in_progress=False,  # exclude in progress results
    status__valid=True,  # exclude any invalid data
    skipped=False,  # exclude skipped results
)
try:
    latest = instances.latest("work_completed")  # get most recent result
    reading1_6mv = None
except TestInstance.DoesNotExist:
    reading1_6mv = None
    UTILS.set_skip("reading1_6mv", True)


Randle Taylor

unread,
Apr 13, 2021, 11:45:38 PM4/13/21
to Landon Clark, QATrack+
Hi Landon,

Yes that looks like it will do what you're after!

R

Reply all
Reply to author
Forward
0 new messages