Skip to content

Adapted skills:check and skills:install and added reusable tests - #966

Open
jana-selva wants to merge 7 commits into
mainfrom
feature/963-multi-skill-support
Open

jana-selva wants to merge 7 commits into
mainfrom
feature/963-multi-skill-support

Conversation

@jana-selva

Copy link
Copy Markdown
Contributor

Fixes #963

Checklist

Note: If any of the items in the checklist are not relevant to your PR, just check the box.

For any Pull Request

Is the following correct:

  • the title of the Pull Request?
  • the title of the corresponding issue?
  • there are no other open Pull Requests for the same update/change?
  • that the issue which this Pull Request fixes ("Fixes...") is mentioned?

When Changes Were Made

Did you:

  • update the changelog?
  • update the cookiecutter-template?
  • update the implementation?
  • check coverage and add tests: unit tests and, if relevant, integration tests?
  • update the User Guide & other documentation?
  • resolve any failing CI criteria (incl. Sonar quality gate)?

When Preparing a Release

Have you:

  • thought about version number (major, minor, patch)?
  • checked Exasol packages for updates and resolved open vulnerabilities, if easily possible?

@jana-selva jana-selva changed the title Implement packaged skill support Adapted skills:check and skills:install and add reusable tests Sep 29, 2026
@jana-selva jana-selva changed the title Adapted skills:check and skills:install and add reusable tests Adapted skills:check and skills:install and added reusable tests Sep 29, 2026
@jana-selva
jana-selva deployed to manual-approval September 29, 2026 08:05 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 29, 2026 08:05 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 29, 2026 08:15 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 29, 2026 08:15 — with GitHub Actions Active
Comment thread doc/changes/unreleased.md Outdated
Comment thread doc/changes/unreleased.md Outdated
Comment thread doc/user_guide/features/agent_skills/index.rst
Comment thread doc/user_guide/features/agent_skills/index.rst
Comment thread doc/user_guide/features/agent_skills/index.rst
Comment thread exasol/toolbox/nox/tasks.py
Comment thread test/unit/nox/_skills_test.py Outdated
]


def test_tasks_exports_skill_tasks():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test I would remove.

I think if we wanted something like this it'd be better to have an integration test running nox -l. That way we could check that the exposed nox sessions are the same against a hard-coded list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think you tried to resolve this by adding test_check_runs_all_project_checks , but I would have you remove test_check_runs_all_project_checks and really check nox -l via a test similar to how test_skills_install_and_check is set up.

Comment thread test/unit/util/skill_test.py
Comment thread test/unit/util/skill_test.py
Comment thread test/unit/skills_test.py
]


def _validate_eval_cases(eval_cases: object, skill_name: str) -> list[str]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please break this up into smaller test functions.
Possible ideas are:

  • Create a validator class which has these methods (mostly private) that uses them in a "main" function.

  • As we're in a testing suite, it might be better to break these up into test methods inside a test class. You can then still iterate over the cases with 1 declaration of @pytest.mark.parametrize("skill_name", _skills_with_eval_cases()) over the class itself. [While I believe you don't need it, if you did need the tests to run in a certain order, you can either group critical ordered ones together in one method or add https://pypi.org/project/pytest-order/#description as a dev dependency and mark the tests.]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, please re-review

@ArBridgeman ArBridgeman Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's not exactly what I meant.
Instead of appending errors, and then checking it, I meant that _validate_eval_cases should be removed and the components it tests for are done individually, like in a structure similar to TestEvalCaseValidation. This would be a much clearer design and easier to debug if an issue arose in the future.

@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:26 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:26 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:28 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:28 — with GitHub Actions Active
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:42 — with GitHub Actions Active
@jana-selva
jana-selva deployed to manual-approval September 30, 2026 09:42 — with GitHub Actions Active
@sonarqubecloud

Copy link
Copy Markdown

@jana-selva
jana-selva added this pull request to stack #969 September 30, 2026 11:18
@ArBridgeman
ArBridgeman self-requested a review September 30, 2026 11:34
.. _developer_agent_skills:

Testing Agent Skills
====================

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💚 Thanks, this is fantastic and exceeds what I was hoping for.

docs_list_links(nox_session)


def test_build_docs_runs_sphinx(nox_session, config):

@ArBridgeman ArBridgeman Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give me more context as to why you added these tests? It's not immediately clear to me in the scope of this issue. If it's just to raise the test coverage, I'd rather this be done in a detected manner.

The Sphinx documentation has many Sonar issues, and it'd be best to resolve those in coordination with the coverage.

build.assert_called_once_with(nox_session, config)


def test_build_docs_command(config):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These kinds of tests are require lots of maintenance, if the code is changed.

docs_list_links(nox_session)


def test_build_docs_runs_sphinx(nox_session, config):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_build_docs_runs_sphinx seems not needed. It only verifies that build_docs() delegates to _build_docs(), while the actual command behavior is already covered by test_build_docs_command. This couples the test to the current internal helper structure rather than testing user-visible behavior. If the documentation build implementation changed, this test would need to change even if the public behavior remained correct.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests like this can also lead to the false impression that there's coverage, as it executes many of the lines, but we're not really testing what we expect it to do.

build.assert_called_once_with(nox_session, config)


def test_build_multiversion_docs_runs_sphinx(nox_session, config):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session.run.assert_any_call("touch", f"{DOCS_OUTPUT_DIR}/.nojekyll")


def test_open_docs_reports_missing_output(nox_session, config):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_open_docs_reports_missing_output only verifies that _SessionQuit is raised, not that the expected error is reported. It would be more useful to assert the message passed to session.error(), or remove the test if exception propagation itself is not part of the contract. As written, it mainly provides branch coverage

This branch was successfully deployed

1 active deployment
manual-approval — 216cddae Deployed Sep 30, 2026 by jana-selva via Merge Gate / Extension / Approve Running Slow Tests? #2838
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

Successfully merging this pull request may close these issues.

Adapt skills:check and skills:install and add reusable tests

2 participants