Skip to content
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

Identify All Tests That Do Not Include Atleast 1 Assertion #494

Closed
derks opened this issue May 8, 2018 · 13 comments
Closed

Identify All Tests That Do Not Include Atleast 1 Assertion #494

derks opened this issue May 8, 2018 · 13 comments

Comments

@derks
Copy link
Member

derks commented May 8, 2018

A lot of tests have been added over the years which were added only for coverage but not actually asserting anything valuable for testing. Would be helpful to have someone identify those tests, and possibly add at least one assertion to them.

This is a low-priority, good first issue... Please note if you're interested in this issue that it is only relevant to the portland branch (Cement 3) currently (or master once portland is merged).

@dliberat
Copy link
Contributor

Hey there, I'd be interested in giving this a crack, but I'm not entirely confident I can do a great job. The way I see it, I'd get to know the codebase for a bit, add an assertion or two here and there, then toss a PR your way so I can get some feedback before I get in deep with all the tests.

If that sounds alright then sign me up! But I'll understand if you'd rather leave this to someone who knows the system a bit better.

@derks
Copy link
Member Author

derks commented May 16, 2018

@garroadran thanks for your interest! Essentially, what I'd be looking for is adding atleast one assertion to any existing tests that don't have any. Getting more familiar with Cement would be ideal, however there is a lot of example to reference throughout all of the tests/ directory.

All tests are PyTest, and are simple assertions. The trick will be figuring out what to assert on.

The best thing to do now would be exactly what you said... make a small change and pull-request, and slowly build up from there. The last thing I want is a huge PR for everything all at once... and I certainly don't want you wasting time going too deep down the wrong paths.

Let me know whatever questions you have... maybe joining slack would help (recently moved from Gitter so it is pretty empty/quiet currently).

@dliberat
Copy link
Contributor

Oh yikes, so sorry. I thought I'd replied to this already!
I was a bit busy over the past few days, but I'll start taking a look at it tonight!

@dliberat
Copy link
Contributor

@derks
The slack link doesn't appear to work. Any chance I can get an updated one?

@dliberat
Copy link
Contributor

Thanks! I've already started working on this, but it might be a few days before I can get back to you with anything concrete. It's difficult to find time during the week :(

@dliberat
Copy link
Contributor

dliberat commented May 27, 2018

Ok, this is only a starter list, but these are the tests that don't have any explicit assertions or with raises assertions in them in the tests/cli, and tests/core directories.

I suspect that a few of these are basically tests of the "I assert that calling this method does not raise an exception" style, although it's hard to be sure about the intent behind the test without an actual assertion there.

  • cli/test_main.py - test_app
  • core/test_extension.py - test_load_extensions
  • core/test_extension.py - test_load_extensions_again
  • core/test_foundation.py - test_add_handler_override_options
  • core/test_foundation.py - test_handler_override
  • core/test_foundation.py - test_loaded
  • core/test_foundation.py - test_passed_handlers
  • core/test_foundation.py - test_add_arg_shortcut
  • core/test_foundation.py - test_reset_output_handler
  • core/test_foundation.py - test_no_handler
  • core/test_foundation.py - test_alternative_module_mapping
  • core/test_foundation.py - test_quiet
  • core/test_foundation.py - test_pre_render_hook
  • core/test_foundation.py - test_config_dirs
  • core/test_foundation.py - test_none_template_handler

dliberat added a commit to dliberat/cement that referenced this issue May 27, 2018
derks added a commit that referenced this issue Jun 23, 2018
@dliberat
Copy link
Contributor

dliberat commented Jul 1, 2018

  • core/test_hook.py - test_register_hook_name_not_defined
  • core/test_hook.py - test_framework_hooks
  • core/test_output.py - ? Needs further checking
  • ext/test_ext_alarm.py - test_alarm_no_timeout
  • ext/test_ext_argparse.py - test_coverage
  • ext/test_colorlog.py - test_colorlog
  • ext/test_ext_daemon.py - test_switch
  • ext/test_ext_generate.py - test_invalid_case
  • ext/test_ext_generate.py - test_no_default
  • ext/test_ext_generate.py - test_generate_from_template_dir
  • ext/test_ext_generate.py - test_generate_default_command
  • test_ext_json.py - test_parse_file_bad_path
  • test_ext_json.py - test_handler_override_options_is_none
  • test_ext_logging - test_alternate_namespaces
  • test_ext_logging - test_clear_loggers
  • test_ext_logging - test_missing_log_dir
  • test_ext_memcached - test_memcached_delete
  • test_ext_watchdog.py - test_watchdog
  • test_ext_watchdog.py - test_watchdog_app_paths
  • test_ext_watchdog.py - test_watchdog_default_event_handler
  • test_ext_watchdog.py - test_watchdog_bad_path
  • test_ext_yaml.py - test_parse_file_bad_path
  • test_ext_yaml.py - test_handler_override_options_is_none

@dliberat dliberat mentioned this issue Jul 21, 2018
@derks
Copy link
Member Author

derks commented Jul 29, 2018

@garroadran does that last PR close this out?

@derks derks added this to the 2.99.2 Portland Development milestone Jul 29, 2018
@derks derks self-assigned this Jul 29, 2018
@derks
Copy link
Member Author

derks commented Jul 30, 2018

Sorry, I saw your comment about the PR addressing core and that you'd be moving on to ext. Thanks!

@derks derks modified the milestones: 2.99.2 Portland Development, 2.99.4 Portland Development Jul 30, 2018
@dliberat
Copy link
Contributor

Yeah, sorry, I was hoping to be a bit further ahead by now, but it's been a crazy month with work. Should be able to sink my teeth into it a bit more this coming weekend.

@dliberat dliberat mentioned this issue Aug 6, 2018
@dliberat
Copy link
Contributor

dliberat commented Aug 9, 2018

This is the last batch. Should be done in a week, two at the most.

  • ext/test_ext_argparse.py - test_coverage
  • ext/test_ext_generate.py - test_generate_from_template_dir
  • ext/test_ext_generate.py - test_generate_default_command
  • ext/test_ext_yaml.py - test_handler_override_options_is_none
  • utils/test_misc.py - test_minimal_logger

@derks
Copy link
Member Author

derks commented Aug 12, 2018

Closing out! This was a huge help... Thank you @garroadran!

@derks derks closed this as completed Aug 12, 2018
@derks derks removed this from the 2.99.4 Portland Development milestone Aug 12, 2018
@derks derks added this to the 2.99.2 Portland Development milestone Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants