-
Notifications
You must be signed in to change notification settings - Fork 354
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
Add tests for mode parsing #793
Conversation
ffb954c
to
9c942c8
Compare
@irssi/developers I'm now testing the "add auto-merge label and ping comment" workflow (see chat for the discussion) |
this PR which was created by @horgh will add a base test layer to irssi, which could hopefully ease the future addition of tests. See #767 for the relevant discussion. As you can see, there is currently 1 failing test, which might be fixed with #766 Due to our use of recursive make, we have one test report per directory sadly, instead of a big one. But I guess it would be fine for now |
Yeah, it looks like the first test case that fails is one that would be fixed by the other PR. I think the test case after it would fail too, but it's not being run. The problem is a ":" in it is not being stripped. |
tests/irc/core/test-irc.c
Outdated
|
||
g_test_init(&argc, &argv, NULL); | ||
|
||
for (i = 0; i < G_N_ELEMENTS(event_get_param_fixtures); i++) { |
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 think we want to iterate over the other array here. That's why some of the test cases aren't running.
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.
omg! good catch
This looks reasonable. Do we need the added files under An improvement might be to write out names of test cases, rather than numbers. It would make seeing which failed a little easier. I realize in my original version it was probably not easy too! I take it you would like to allow failing tests in PRs/master if that shows a bug? I'd usually expect tests to always be passing in master or before merging, even if there is a bug. Basically it would be nice if we could say that master's build is always passing. Then for example with PRs we could say that all tests must pass in order to be merged. Otherwise it seems like there would be a risk that tests would be failing and we could assume it's for one reason but it's because of a new bug. Take what we have here for example: They're failing but it's not clear unless you happen to know about that other bug. And maybe we're right they would pass if we merged it, but it's not guaranteed. |
The utils are not strictly necessary, however they are the ones references in automake/TAP in this Stackoverflow post: https://stackoverflow.com/questions/19958861/how-to-properly-set-up-glib-testing-framework-with-autotools The main advantage is, as far as I can tell, that they will output more details. Instead of (plain program, automake tests only)
we get the full output visible:
|
unfortunately, as far as I can tell, there is no way to to have 2 badges: |
if there are bugs, it's much better to have failing tests than to have no tests. however, the build (compile) should not fail on master. and new commits should ideally not make existing (already passed) tests fail. if it is easier to add tests of broken behaviour, we can use some ideas from test driven development with the anticipation of fixing all tests eventually |
Oh yeah, having that output is way better! That's sort of what I was getting at with the badges idea. But what you say makes sense. We can fix the bugs! |
you can sort of spot it in the Travis detail view, four green is good compile, the red one are the tests. would be nice to be able to differentiate but idk how |
I found one tunable which is allow_failures in travis. not sure about it, now it will basically ignore the test result and mark our build as green as before |
This uses GLib's testing framework. It is to test the changes to the mode parsing for irssi#603.
Fix wrong array (missing an s)
Fixes #776