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

Unit tests are failing #9

Closed
ubajze opened this issue Jun 11, 2021 · 0 comments
Closed

Unit tests are failing #9

ubajze opened this issue Jun 11, 2021 · 0 comments

Comments

@ubajze
Copy link
Contributor

ubajze commented Jun 11, 2021

When the invoke unittest command is used, unit tests are failing.

This is the output from my local machine:

➜  nautobot-plugin-data-validation-engine git:(travis) poetry run invoke unittest
Creating nautobot_data_validation_engine_nautobot_run ... done
Wrapping model clean methods for custom validators failed because the ContentType table was not available or populated. This is normal during the execution of the migration command for the first time.
Creating test database for alias 'default'...

System check identified no issues (0 silenced).
.......................................FFFF...FF.............................................................................
======================================================================
FAIL: test_empty_field_values_raise_validation_error (nautobot_data_validation_engine.tests.test_custom_validators.MinMaxValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 89, in test_empty_field_values_raise_validation_error
    site.clean()
AssertionError: ValidationError not raised

======================================================================
FAIL: test_field_value_type_raise_validation_error (nautobot_data_validation_engine.tests.test_custom_validators.MinMaxValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 108, in test_field_value_type_raise_validation_error
    site.clean()
AssertionError: ValidationError not raised

======================================================================
FAIL: test_max_violation_raise_validation_error (nautobot_data_validation_engine.tests.test_custom_validators.MinMaxValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 146, in test_max_violation_raise_validation_error
    site.clean()
AssertionError: ValidationError not raised

======================================================================
FAIL: test_min_violation_raise_validation_error (nautobot_data_validation_engine.tests.test_custom_validators.MinMaxValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 127, in test_min_violation_raise_validation_error
    site.clean()
AssertionError: ValidationError not raised

======================================================================
FAIL: test_empty_field_values_coerced_to_empty_string (nautobot_data_validation_engine.tests.test_custom_validators.RegularExpressionValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 64, in test_empty_field_values_coerced_to_empty_string
    site.clean()
AssertionError: ValidationError not raised

======================================================================
FAIL: test_invalid_regex_matches_raise_validation_error (nautobot_data_validation_engine.tests.test_custom_validators.RegularExpressionValidationRuleModelTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/source/nautobot_data_validation_engine/tests/test_custom_validators.py", line 30, in test_invalid_regex_matches_raise_validation_error
    site.clean()
AssertionError: ValidationError not raised

----------------------------------------------------------------------
Ran 125 tests in 6.259s

FAILED (failures=6)
Destroying test database for alias 'default'...

The same result is also seen on Travis:
https://travis-ci.com/github/nautobot/nautobot-plugin-data-validation-engine/builds/228644947

Because of this, the invoke unittest command is currently disabled in .travis.yml. It should be re-enabled after unit tests are fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants