Skip to content

Use POSIX-compatible conditionals in install test helper invoked via sh#779

Merged
tammy-baylis-swi merged 2 commits into
NH-135284-otel-python-1_42_1from
copilot/fix-code-review-comment
Jun 4, 2026
Merged

Use POSIX-compatible conditionals in install test helper invoked via sh#779
tammy-baylis-swi merged 2 commits into
NH-135284-otel-python-1_42_1from
copilot/fix-code-review-comment

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The linked review comment flagged bash-only [[ ... ]] usage in tests/docker/install/_helper_run_install_tests.sh, which is executed with sh. This change keeps the script behavior intact while making the macOS detection logic POSIX-shell compatible.

  • Scope: targeted shell compatibility fix

    • Replaced bash-specific prefix checks:
      • [[ "$OSTYPE" == "darwin"* ]]
    • With POSIX-safe parameter-expansion checks:
      • [ "${OSTYPE#darwin}" != "$OSTYPE" ]
    • Applied in both relevant branches of the script’s OS detection logic.
  • Behavioral intent

    • Preserve existing branch selection and variable assignment flow.
    • Avoid shell parsing/runtime failures under dash/POSIX sh in install-test environments.
  • Representative diff

    -if [[ "$OSTYPE" == "darwin"* ]] || [ -n "$PYTHON_VERSION" ];
    +if [ "${OSTYPE#darwin}" != "$OSTYPE" ] || [ -n "$PYTHON_VERSION" ];
    ...
    -    if [[ "$OSTYPE" == "darwin"* ]]; then
    +    if [ "${OSTYPE#darwin}" != "$OSTYPE" ]; then

Copilot AI changed the title [WIP] Fix code based on review comment from PR #778 Use POSIX-compatible conditionals in install test helper invoked via sh Jun 4, 2026
Copilot AI requested a review from tammy-baylis-swi June 4, 2026 00:16
@tammy-baylis-swi tammy-baylis-swi marked this pull request as ready for review June 4, 2026 00:35
@tammy-baylis-swi tammy-baylis-swi requested review from a team as code owners June 4, 2026 00:35
@tammy-baylis-swi tammy-baylis-swi merged commit 745ffad into NH-135284-otel-python-1_42_1 Jun 4, 2026
47 checks passed
@tammy-baylis-swi tammy-baylis-swi deleted the copilot/fix-code-review-comment branch June 4, 2026 00:35
tammy-baylis-swi added a commit that referenced this pull request Jun 4, 2026
* Bump opentelemetry-instrumentation-aws-lambda (#769)

Bumps the otel-dependencies group with 1 update in the /lambda/tests directory: [opentelemetry-instrumentation-aws-lambda](https://github.com/open-telemetry/opentelemetry-python-contrib).


Updates `opentelemetry-instrumentation-aws-lambda` from 0.62b1 to 0.63b1
- [Release notes](https://github.com/open-telemetry/opentelemetry-python-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-python-contrib/commits)

---
updated-dependencies:
- dependency-name: opentelemetry-instrumentation-aws-lambda
  dependency-version: 0.63b1
  dependency-type: direct:production
  dependency-group: otel-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Upgrade Otel Python 1.42.1/0.63b1

* Drop py3.9 and centos; py3.10 for builds/tests

* lint api

* Rm unnecessary, outdated test assertions

* Fix py3.10 install tests and Amzn2 is ok

* fix

* fix 2

* Fix another downgrade

* Separate install-tests-amazon2 job in verify_install

* Fix

* Debug

* More debug

* Revert "Debug"

This reverts commit 393d8e8.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Use POSIX-compatible conditionals in install test helper invoked via `sh` (#779)

* Initial plan

* Fix install helper to use POSIX shell conditionals

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
tammy-baylis-swi added a commit that referenced this pull request Jun 4, 2026
* Bump opentelemetry-instrumentation-aws-lambda (#769)

Bumps the otel-dependencies group with 1 update in the /lambda/tests directory: [opentelemetry-instrumentation-aws-lambda](https://github.com/open-telemetry/opentelemetry-python-contrib).


Updates `opentelemetry-instrumentation-aws-lambda` from 0.62b1 to 0.63b1
- [Release notes](https://github.com/open-telemetry/opentelemetry-python-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-python-contrib/commits)

---
updated-dependencies:
- dependency-name: opentelemetry-instrumentation-aws-lambda
  dependency-version: 0.63b1
  dependency-type: direct:production
  dependency-group: otel-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Upgrade Otel Python 1.42.1/0.63b1

* Drop py3.9 and centos; py3.10 for builds/tests

* lint api

* Rm unnecessary, outdated test assertions

* Fix py3.10 install tests and Amzn2 is ok

* fix

* fix 2

* Fix another downgrade

* Separate install-tests-amazon2 job in verify_install

* Fix

* Debug

* More debug

* Revert "Debug"

This reverts commit 393d8e8.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Use POSIX-compatible conditionals in install test helper invoked via `sh` (#779)

* Initial plan

* Fix install helper to use POSIX shell conditionals

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Add 3.14 to lambda, macos/windows tests

* Add 3.14 linux install tests

* Align Lambda publish runtime list with Python 3.14 test coverage (#782)

* Initial plan

* Add Python 3.14 lambda tox and workflow test matrix coverage

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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