-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
requirements.txt: Update Errbot #572
Conversation
Travis tests have failedHey @nvzard, 1st Buildpython -m pytest
|
errbotio/errbot@9a03b72#diff-86fb3ee3298c4b1416b1da174131201c |
Travis tests have failedHey @nvzard, 1st Buildpython -m pytest
|
af0fa0b
to
04e6197
Compare
177eb1b
to
1bfc960
Compare
Travis tests have failedHey @nvzard, 1st Buildpython -m pytest
|
Travis tests have failedHey @nvzard, 1st Buildpython -m pytest
|
weird, all the tests are passing locally |
tests/helper.py
Outdated
config = config if config else dict() | ||
testbot = TestBot(loglevel=loglevel, extra_config=config) | ||
testbot.start() | ||
plug = testbot.bot.plugin_manager.instanciateElement(klass) | ||
plug = klass(testbot.bot, plugin_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def instanciateElement(self, element) -> BotPlugin:
"""Overrides the instanciation of plugins to inject the bot reference."""
return element(self.bot, name=self._current_pluginfo.name)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@meetmangukiya @gbin does it make a difference, where a class gets instantiated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is not the cause for failures. Facing the TemplateNotFound
exception due to the changes made to errbot.templating
by this commit errbotio/errbot@9a03b72#diff-b27e6e3f6d8b53f810de95de950feea9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured a workaround, explore yourself further, here's the patch that fixes it:
From d9858f2dc7162273d8315ae37bfee6467257599e Mon Sep 17 00:00:00 2001
From: Meet Mangukiya <[email protected]>
Date: Wed, 11 Jul 2018 06:44:23 +0530
Subject: [PATCH] Fix templating issue
---
tests/labhub_test.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/tests/labhub_test.py b/tests/labhub_test.py
index 9d69a64..e06b195 100644
--- a/tests/labhub_test.py
+++ b/tests/labhub_test.py
@@ -19,9 +19,21 @@ from plugins.labhub import LabHub
from tests.helper import plugin_testbot
+
+import errbot
+from errbot.plugin_info import PluginInfo
+from errbot.templating import add_plugin_templates_path
+from pathlib import Path
+
+
class TestLabHub(unittest.TestCase):
def setUp(self):
+ labhub_info_path = Path(__file__).parent / '..' / 'plugins' / 'labhub.plug'
+ with labhub_info_path.open() as plugfile:
+ labhub_info = PluginInfo.load_file(plugfile, labhub_info_path)
+ add_plugin_templates_path(labhub_info)
+
plugins.labhub.github3 = create_autospec(github3)
self.mock_org = create_autospec(github3.orgs.Organization)
--
2.18.0
Comment on c5f4d95, file plugins/ban.py, line 73. Broken link - unable to connect to https://api.gitter.im/v1/rooms/ Origin: InvalidLinkBear, Section: |
Comment on f9e7c7e, file plugins/ban.py, line 39. Broken link - unable to connect to https://api.gitter.im/v1/rooms/ Origin: InvalidLinkBear, Section: |
Comment on b0c095c, file tests/labhub_test.py, line 417. Broken link - unable to connect to https://gitlab.com/a/b/merge_requests/2 Origin: InvalidLinkBear, Section: |
908d92a
to
349e60f
Compare
Travis tests have failedHey @nvzard, 1st Buildcoala --non-interactive -V
python -m pytest
|
Comment on b0c095c, file tests/labhub_test.py, line 417. Broken link - unable to connect to https://gitlab.com/a/b/merge_requests/2 Origin: InvalidLinkBear, Section: |
Comment on b0c095c, file tests/labhub_test.py, line 417. Broken link - unable to connect to https://gitlab.com/a/b/merge_requests/2 Origin: InvalidLinkBear, Section: |
Comment on b0c095c, file tests/labhub_test.py, line 417. Broken link - unable to connect to https://gitlab.com/a/b/merge_requests/2 Origin: InvalidLinkBear, Section: |
Comment on 672e516, file plugins/pitchfork.py, line 35. Broken link - unable to connect to https://gitter.im/coala/coala/offtopic Origin: InvalidLinkBear, Section: |
Comment on 672e516, file plugins/ship_it.py, line 14. Broken link - unable to connect to http://i.imgur.com/DPVM1.png Origin: InvalidLinkBear, Section: |
Shift from `tests.helper.plugin_testbot` to `CoroboTestCase` for loading plugins in the TestBot. Closes coala#584
Comment on b0c095c, file tests/labhub_test.py, line 417. Broken link - unable to connect to https://gitlab.com/a/b/merge_requests/2 Origin: InvalidLinkBear, Section: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of little things, but mostly not your problem.
I am quite worried that the private chat test is still disabled.
labhub._teams = self.teams | ||
mock_dict = { | ||
'TEAMS': self.teams, | ||
'is_room_member': MagicMock(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think you need to inject a mock for is_room_member
.
Probably can just move staticmethod
is_room_member
out of the class, and then use normal patching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened a difficulty/low issue for all these minor changes #594
'is_room_member': MagicMock(), | ||
} | ||
self.inject_mocks('LabHub', mock_dict) | ||
testbot = self | ||
|
||
plugins.labhub.os.environ['GH_TOKEN'] = 'patched?' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line isnt necessary any more either,
or , it shouldnt be in test_invite_cmd
-- it should be in a separate test method.
|
||
plugins.labhub.os.environ['GH_TOKEN'] = 'patched?' | ||
|
||
self.assertEqual(labhub.TEAMS, self.teams) | ||
self.assertEqual(self.labhub.TEAMS, self.teams) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test was only confirming the mock was in place. assertEqual
is wrong. It should be assertIs
.
@@ -79,7 +97,7 @@ def test_invite_cmd(self): | |||
|
|||
# invite by developer | |||
mock_team_maintainers.is_member.return_value = False | |||
labhub.is_room_member = MagicMock(return_value=True) | |||
mock_dict['is_room_member'].return_value = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is already True.
unnecessary.
@@ -161,14 +162,8 @@ def test_create_issue_cmd(self): | |||
# Stop ignoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isnt fixed in the new errbot ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jayvdb ACL's are working as they are supposed to. But it is not actually possible to test ACLs since the message/ACL cannot be mocked from here.
ACL is well tested by the framework as it is an upstream plugin and tested upstream, one always trusts their upstream or dependencies.
ack a9d99de |
@gitmate-bot ff |
Hey! I'm GitMate.io! This pull request is being fastforwarded automatically. Please DO NOT push while fastforward is in progress or your changes would be lost permanently |
Automated fastforward with GitMate.io was successful! 🎉 |
Closes #571
Closes #584