Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PyBugReporter/src/BugReporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> N
headers = {"Authorization": f"Bearer {handler.githubKey}"}

# query variables
repoId = cls._getRepoId(cls, handler)
repoId = asyncio.run(cls._getRepoId_async(cls, handler))
bugLabel = "LA_kwDOJ3JPj88AAAABU1q15w"
autoLabel = "LA_kwDOJ3JPj88AAAABU1q2DA"

Expand Down Expand Up @@ -414,7 +414,12 @@ def manualBugReport(cls, repoName: str, errorTitle: str, errorMessage: str) -> N
}
}

issueExists = cls._checkIfIssueExists(cls, handler, errorTitle)
issueExists = asyncio.run(cls._checkIfIssueExists_async(cls, handler, errorTitle))

# Send to Discord if applicable
if cls.handlers[repoName].useDiscord:
discordBot = DiscordBot(cls.handlers[repoName].botToken, cls.handlers[repoName].channelId)
asyncio.run(discordBot.send_message(f"## {repoName}: {errorTitle}\n{errorMessage}", issueExists))

if (issueExists == False):
result = asyncio.run(client.execute_async(query=createIssue, variables=variables, headers=headers))
Expand Down
82 changes: 44 additions & 38 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

BugReporter.setVars(token, 'PyBugReporter', 'byuawsfhtl', False, True, discordToken, channelId)

BugReporter.manualBugReport("PyBugReporter",
"Testing manual bug report",
"This is a test of the manual bug report functionality")

@BugReporter('PyBugReporter', extraInfo=True, env='test')
def test(item, item2=None):
# raise Exception("""
Expand Down Expand Up @@ -53,43 +57,45 @@ def test(item, item2=None):
# really really really really really really really really long test exception
# """)

def this():
def exception():
def has():
def an():
def insane():
def traceback():
def length():
def that():
def just():
def keeps():
def going():
def on():
def yep():
def still():
def more():
def never():
def do():
def this():
raise Exception("This is a test exception")
this()
do()
never()
more()
still()
yep()
on()
going()
keeps()
just()
that()
length()
traceback()
insane()
an()
has()
exception()
this()
# def this():
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for keeping commented out code in the test? Do you sometimes uncomment and run it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i was doing that to test various conditions for the error, like when certain parts are really long

# def exception():
# def has():
# def an():
# def insane():
# def traceback():
# def length():
# def that():
# def just():
# def keeps():
# def going():
# def on():
# def yep():
# def still():
# def more():
# def never():
# def do():
# def this():
# raise Exception("This is a test exception")
# this()
# do()
# never()
# more()
# still()
# yep()
# on()
# going()
# keeps()
# just()
# that()
# length()
# traceback()
# insane()
# an()
# has()
# exception()
# this()

raise Exception("This is a test exception")


test(None, item2='item2')
# test(None, item2='item2')