Closed VSevagen closed 3 years ago
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
/home/runner/work/grimoirelab-elk/grimoirelab-elk/grimoire_elk/enriched/github.py | 2 | 75.0% | ||
<!-- | Total: | 2 | --> |
Totals | |
---|---|
Change from base Build 718888590: | 0.0% |
Covered Lines: | 8612 |
Relevant Lines: | 10469 |
How does it exactly improves the coverage? What cases are checked here that weren't before?
the elif
condition on line 133 of telegram.py was never covered as the test case for it was not present in the json file. I just added an additional object without the text
field but with the sticker
field to trigger the sticker
condition on line 133.
How does it exactly improves the coverage? What cases are checked here that weren't before?
the
elif
condition on line 133 of telegram.py was never covered as the test case for it was not present in the json file. I just added an additional object without thetext
field but with thesticker
field to trigger thesticker
condition on line 133.
In that case, I think it's better to create a pair of tests where it's checked whether the reply_to_message
contains the sticker or the text. Covering the case doesn't mean the case is working properly.
Sorry for the delay @sduenas
I made a pair of tests to check for message
and sticker
. text
is not really available as it get maps to message
.
@sduenas I updated the PR according to what you said. Not really sure if that's what you meant but I think I got it this time
@sduenas I updated the PR according to what you said. Not really sure if that's what you meant but I think I got it this time
Kinda of. What I meant is. We know what item have the sticker
data on it, so check that for that specific item, the exact value (the exact string) is there. It would be something like:
item = self.items[x] <- change x by the index number of the item with the sticker
[...]
self.assertEqual(message['reply_to_message']['sticker'], "sticker value") <- change 'sticker value' for the real value
@sduenas but we're checking for sticker
in reply_to_message
. Right now, i think there is no item that has it. There are items that has sticker
but not reply_to_message
and vice versa. I was checking telegram.json.
Should I create an item ?
@sduenas but we're checking for
sticker
inreply_to_message
. Right now, i think there is no item that has it. There are items that hassticker
but notreply_to_message
and vice versa. I was checking telegram.json. Should I create an item ?
Yes, that's it. If there are no item with a value, let's create it because otherwise we are testing nothing.
@sduenas I have a doubt regarding the sticker
value. I didn't know how the sticker format would be like so i checked one existing format in the same json file. I'm not seeing any value for sticker
. Its mostly a collection of other fields and values.
So to see what was being asserted, I checked the value for message[reply_to_message][sticker]
. That turned out to be the collection of fields in sticker. Am I confusing something ?
I also updated the PR with the new item.
@sduenas I have a doubt regarding the
sticker
value. I didn't know how the sticker format would be like so i checked one existing format in the same json file. I'm not seeing any value forsticker
. Its mostly a collection of other fields and values. So to see what was being asserted, I checked the value formessage[reply_to_message][sticker]
. That turned out to be the collection of fields in sticker. Am I confusing something ?I also updated the PR with the new item.
I think we can leave it that way. The PR looks good to me.
Merged. Thanks for your contribution.
Coverage was missing for line 133-134. This commit fixes that.
Signed-off-by: sevagenv sevagenv@gmail.com