Skip to content

Feature/#25 - Add command line option --script-languages#28

Draft
kratz00 wants to merge 7 commits into
mainfrom
feature/#25-slc-cmdline
Draft

Feature/#25 - Add command line option --script-languages#28
kratz00 wants to merge 7 commits into
mainfrom
feature/#25-slc-cmdline

Conversation

@kratz00

@kratz00 kratz00 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Fixes #25

@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 06:17 — with GitHub Actions Inactive
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 07:38 — with GitHub Actions Inactive
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from 62fe971 to ee4237b Compare June 12, 2026 07:57
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 07:57 — with GitHub Actions Inactive
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from ee4237b to e0019d2 Compare June 12, 2026 08:15
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 08:15 — with GitHub Actions Inactive
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from e0019d2 to 6ebedfd Compare June 12, 2026 08:20
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 08:20 — with GitHub Actions Inactive
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from 6ebedfd to ed55c55 Compare June 12, 2026 08:28
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 08:29 — with GitHub Actions Inactive
@kratz00 kratz00 temporarily deployed to manual-approval June 12, 2026 08:54 — with GitHub Actions Inactive
@exasol exasol deleted a comment from sonarqubecloud Bot Jun 12, 2026
@kratz00 kratz00 changed the title Feature/#25 slc cmdline Feature/#25 - Add command line option --script-languages Jun 19, 2026
@kratz00 kratz00 temporarily deployed to manual-approval June 22, 2026 09:09 — with GitHub Actions Inactive
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from 3e7b671 to dd40abf Compare June 25, 2026 05:50
@kratz00 kratz00 temporarily deployed to manual-approval June 25, 2026 05:50 — with GitHub Actions Inactive
Comment thread exasol/pytest_slc/__init__.py
Comment thread test/integration/pytester/test_script_languages_onprem.py
"""
The operation will be skipped if SCRIPT_LANGUAGES_OPTION is defined.
"""
if request.config.getoption(SCRIPT_LANGUAGES_OPTION):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need a test for this interaction

Comment thread exasol/pytest_slc/__init__.py
Comment thread test/integration/pytest_slc_test.py Outdated
result.assert_outcomes(passed=2, skipped=0)


def test_pytest_slc_skip(pytester):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

got moved to test/integration/skip_test.py

pytest_plugins = ["pytester"]


def test_empty_value_for_script_languages_raises_wrapper(pytester):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we need another test when the option is not set at all, how the script_languages fixtures react

@kratz00 kratz00 closed this Jul 2, 2026
@kratz00 kratz00 reopened this Jul 2, 2026
@kratz00 kratz00 requested a deployment to manual-approval July 2, 2026 09:37 — with GitHub Actions Waiting
@kratz00

kratz00 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@kratz00

kratz00 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@chatgpt-codex-connector

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@kratz00

kratz00 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd40abf231

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

pyexasol_connection_, LanguageActivationLevel.Session
)
set_script_languages(pyexasol_connection_, script_languages_)
yield

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ensure script languages are restored after failures

When a test using activate_script_languages_for_module or activate_script_languages_for_session fails or errors, contextlib throws that exception into this bare yield, so the reset call after it is skipped. That leaves the shared pyexasol_connection session configured with the override for later tests or teardown; wrap the yield in try/finally so the original SCRIPT_LANGUAGES value is always restored.

Useful? React with 👍 / 👎.

@kratz00 kratz00 Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@chatgpt-codex-connector In a yield fixture, the code after the yield is always executed as teardown, even if the test fails or raises an exception.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@codex address that feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@codex address that feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Wrapped activate_script_languages teardown in a try/finally block so the previous SCRIPT_LANGUAGES value is restored even when the context body raises. exasol/pytest_slc/init.pyL225-L230
  • Added a unit test that exercises an exception inside activate_script_languages and verifies the original script language setting is restored. test/unit/script_languages_unit_test.pyL8-L29
  • Committed the changes on the current branch with commit 78482ce and created a PR titled “Fix script language restoration after context errors”.

Testing

  • poetry run python -m black --target-version py312 --check exasol/pytest_slc/__init__.py test/unit/script_languages_unit_test.py
  • poetry run pytest test/unit
  • ⚠️ poetry run pytest test/unit test/integration/script_languages_test.py — integration checks failed because local Docker/ITDE database startup is unavailable in this environment.

View task →

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In a yield fixture, the code after the yield is always executed as teardown, even if the test fails or raises an exception. @codex address that feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Summary

  • Wrapped activate_script_languages teardown in a try/finally so direct context-manager usage restores the previous SCRIPT_LANGUAGES value even when the body raises. exasol/pytest_slc/init.pyL217-L230
  • Added a unit test that simulates an exception inside activate_script_languages and verifies the temporary value is reset to the previous setting. test/unit/script_languages_unit_test.pyL14-L31
  • Committed the changes on the current branch with commit 9204c47 and created a PR titled “Fix script language restoration after context errors”.

Testing

  • poetry run python -m black --target-version py310 --check exasol/pytest_slc/__init__.py test/unit/script_languages_unit_test.py
  • poetry run pytest test/unit

View task →

@kratz00 kratz00 requested a deployment to manual-approval July 2, 2026 14:53 — with GitHub Actions Waiting
@kratz00

kratz00 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5a096feafa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

pyexasol_connection_, LanguageActivationLevel.Session
)
set_script_languages(pyexasol_connection_, script_languages_)
yield

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore script languages from a finally block

When callers use activate_script_languages directly as a context manager and the body raises, that exception is thrown back at this yield, so the reset on the next line is skipped and the shared pyexasol_connection can keep the temporary SCRIPT_LANGUAGES value for later tests. Wrap the yield in try/finally so failing UDF tests do not contaminate the rest of the run.

Useful? React with 👍 / 👎.

@kratz00 kratz00 requested a deployment to manual-approval July 3, 2026 12:23 — with GitHub Actions Waiting
kratz00 added 7 commits July 7, 2026 13:28
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
Signed-off-by: Steffen Pankratz <steffen.pankratz@exasol.com>
@kratz00 kratz00 force-pushed the feature/#25-slc-cmdline branch from 20bae72 to 81fe648 Compare July 7, 2026 11:49
@kratz00 kratz00 requested a deployment to manual-approval July 7, 2026 11:49 — with GitHub Actions Waiting
@kratz00 kratz00 requested a deployment to manual-approval July 7, 2026 11:49 — with GitHub Actions Waiting
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
53.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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.

Add command line option --script-languages

2 participants