Extension testing problem - Unable to import settings_local.py

31 views
Skip to first unread message

Petr Grenar

unread,
Apr 8, 2020, 9:05:45 AM4/8/20
to Review Board Community
Hello again,

I managed to create a sample extension for my board. Basically, it does nothing. I managed to build a package and develop the package. The extension is now imported and enabled on my board.

Next, I want to test, if the extension is loaded correctly. I placed a print statement to the extension initialization part. Then I tried to write a simple unit test for it. I was following the manual and created a simple test.py file.  But I didn't quite get where I should put the test folder with test files. So I tried to put it into the extension folder. When I tried to run rbext test -m extension it finishes with error: Unable to import settings_local.py: No module named settings_local.

 I tried to find those files and I found them in reviewboard extensions directory in /conf dir. So I moved the test folder directly to the reviewboard directory. It ended with the same error.

This is my folders tree:

-/python_2.7.5
 |->/extension
   |->/build
   |->/dist
   |->/sample_extension
      |->.extensi-.py.swp
      |->__init__.py
      |->__init__.pyc
      |->extension.py
      |->extension.pyc
   |->/sample_egg-info
   |->/test
      |->test.py
   |->setup.py
 |->reviewboard
...

You can see the test.py file attached in the picture as well as the extension on my board.

Am I doing it the right way?

test.py.png
boardextension.png

Christian Hammond

unread,
Apr 9, 2020, 10:16:28 PM4/9/20
to revie...@googlegroups.com
Hi Petr,

It should be automatically locating a settings_local.py that's provided as part of Review Board for testing purposes. Can you confirm for me the version of Review Board you're working with?

What does this show:

python -c 'from reviewboard.cmdline import rbext; print(rbext.__file__)'

Can you show me the full backtrace of the settings_local.py error?

Christian

--
Supercharge your Review Board with Power Pack: https://www.reviewboard.org/powerpack/
Want us to host Review Board for you? Check out RBCommons: https://rbcommons.com/
Happy user? Let us know! https://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups "Review Board Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to reviewboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/reviewboard/de44552f-1489-4437-b607-4fa69c7f5466%40googlegroups.com.


--
Christian Hammond
President/CEO of Beanbag
Makers of Review Board

Petr Grenar

unread,
Apr 14, 2020, 2:17:04 AM4/14/20
to Review Board Community

Hello Christian,

I am running Reviewboard 2.5.17. The error that I described is now out because my VM broke down and I had to start over. I will get it touch if I run in other trouble :)

Petr

Dne pátek 10. dubna 2020 4:16:28 UTC+2 Christian Hammond napsal(a):
To unsubscribe from this group and stop receiving emails from it, send an email to revie...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages