Plugin testing takes way too long

30 views
Skip to first unread message

sup...@schynet.com

unread,
Feb 15, 2021, 5:12:09 PM2/15/21
to NetBox
When writing unit tests for plugins similar to how the onboarding plugin does, tests take minutes to complete. This is because the test will fire up the container, create the test db, then run the tests. Is there a quicker method for running the tests? Would it be okay to just docker exec manage.py test {app}? 

Glenn Matthews

unread,
Feb 16, 2021, 8:38:22 AM2/16/21
to sup...@schynet.com, NetBox
In general that *should* work; additionally you can save a lot of time on *re*runs of the test if you use `manage.py test {app} --keepdb` so that it saves the baseline test DB between test runs instead of destroying and recreating it every time.

Hope this helps,

Glenn

On Mon, Feb 15, 2021 at 5:12 PM sup...@schynet.com <sup...@schynet.com> wrote:
When writing unit tests for plugins similar to how the onboarding plugin does, tests take minutes to complete. This is because the test will fire up the container, create the test db, then run the tests. Is there a quicker method for running the tests? Would it be okay to just docker exec manage.py test {app}? 

--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/441633ad-e685-4458-a445-9a167795d499n%40googlegroups.com.


--
Glenn Matthews

Sr. Network Automation Consultant

Network to Code, LLC
e: glenn.m...@networktocode.com

Reply all
Reply to author
Forward
0 new messages