Skip to content

Fix unit test failures in CI#165

Merged
cigamit merged 4 commits into
ctrliq:mainfrom
blaipr:fix-unit-test-failures
Jul 10, 2026
Merged

Fix unit test failures in CI#165
cigamit merged 4 commits into
ctrliq:mainfrom
blaipr:fix-unit-test-failures

Conversation

@blaipr

@blaipr blaipr commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Verification

With ctrliq/ascender#573 applied to the ascender checkout, the full unit test suite passes locally: 149 passed, including test_completeness and test_export_simple.

@cigamit cigamit self-assigned this Jul 7, 2026
@cigamit

cigamit commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

ERROR: Found 1 pep8 issue(s) which need to be resolved:
ERROR: tests/unit/test_module_utils.py:165:1: E303: too many blank lines (5)

@blaipr

blaipr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Fixed in e35691d

The blank lines left after removing test_no_templated_values have been reduced from 5 to 2. All lint checks pass now.

@cigamit

cigamit commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator
=============================== warnings summary ===============================
../../../../../opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/dateutil/tz/tz.py:37
  /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/dateutil/tz/tz.py:37: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    EPOCH = datetime.datetime.utcfromtimestamp(0)

../../../../../opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/pyparsing.py:108
  /opt/hostedtoolcache/Python/3.12.13/x64/lib/python3.12/site-packages/pyparsing.py:108: DeprecationWarning: module 'sre_constants' is deprecated
    import sre_constants

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/unit/test_completeness.py::test_completeness - Exception: One or more failures caused issues
FAILED tests/unit/test_export.py::test_export_simple - ValueError: Failed to find assets['job_templates'][name] = 'test-jt' valid values are []
============= 2 failed, 147 passed, 2 warnings in 62.00s (0:01:01) =============

…filter

- Move the new API fields (webhook_key, webhook_ref_filter,
  webhook_service, max_retries) from no_api_parameter_ok to
  needs_param_development. no_api_parameter_ok only applies when the
  module has a parameter the API lacks; these are the opposite case
  (new API fields the modules do not support yet), which is exactly
  what needs_param_development is for. Also add job_slice_pinned_hosts,
  which was still failing.
- Drop the IgnoreNaturalKeyFilter from export.py. Filtering the log
  message cannot fix the export (awxkit still drops the assets), and it
  would hide the genuine natural-key errors that mean the export is
  incomplete. The real fix is in awxkit (ctrliq/ascender#573).
@blaipr

blaipr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

I pushed a rework of the test fixes after looking closer at why the unit test job was still red:

  • The no_api_parameter_ok entries I added for webhook_key, webhook_ref_filter, webhook_service and max_retries were no-ops. That list is only consulted when the module has a parameter the API lacks, and these failures are the opposite direction (new API fields the modules do not support yet). They now live in needs_param_development, which is the bucket designed for exactly that case, and I added job_slice_pinned_hosts which was also failing.
  • I dropped the IgnoreNaturalKeyFilter from export.py. Filtering the log message cannot fix the export (awxkit still drops the affected assets, which is what test_export_simple actually checks), and the substring also matches awxkit's genuine fatal natural key error, so the filter would hide real incomplete exports. The proper fix is on the awxkit side in Skip related endpoints without NATURAL_KEY during awxkit export ascender#573.

Note the merge order: CI installs awxkit from the ascender default branch, so the unit test job here stays red until ctrliq/ascender#573 merges. With that PR applied to the ascender checkout, the full suite passes locally: 149 passed, including test_completeness and test_export_simple.

test_no_templated_values used to catch a mismatch between the hardcoded
_COLLECTION_VERSION and galaxy.yml; it was dropped along with the other
unit test fixes. Add test_collection_version_matches_galaxy_yml to keep
that guarantee: it loads controller_api.py through the collection_import
fixture and compares _COLLECTION_VERSION against galaxy.yml's version.

Also update tools/README.md: the source no longer carries a
0.0.1-devel placeholder, it ships the real released version, so
template_galaxy.yml is now only needed for non-default namespace
builds or to stamp a different version at build time.
@cigamit
cigamit merged commit b90d5f9 into ctrliq:main Jul 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants