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

Fix CI #2367

Merged
merged 4 commits into from
Nov 8, 2023
Merged

Fix CI #2367

merged 4 commits into from
Nov 8, 2023

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Nov 7, 2023

This makes CI green, without adding support for Python 3.12 or figuring out why the server tests are not running anymore.

@pquentin pquentin requested a review from JoshMock November 7, 2023 14:05
Copy link
Member Author

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Forgot to send my comments apparently.

Comment on lines -22 to -36
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install dependencies
run: |
python3 -m pip install nox
- name: Build the docs
run: nox -s docs

Copy link
Member Author

Choose a reason for hiding this comment

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

GitHub defaults to 3.x to 3.12, which breaks this check, and since the Read the Docs check has been working well, I'm just removing this one.

test-linux:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
experimental: [false]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
Copy link
Member Author

Choose a reason for hiding this comment

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

Python 3.11 is stable now. I don't believe having a failing check is helpful in any way, so I'm also removing the experimental variable.

@@ -3,7 +3,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3"
python: "3.11"
Copy link
Member Author

Choose a reason for hiding this comment

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

Python 3.12 breaks Read the Docs. I'll fix this in a follow-up PR.

Comment on lines -18 to +19
# No wheels for Python 3.10 yet!
numpy; python_version<"3.10"
pandas; python_version<"3.10"
numpy
pandas
Copy link
Member Author

Choose a reason for hiding this comment

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

Those projects have recent wheels, including Python 3.12 wheels.

@@ -3,7 +3,7 @@ ignore = E203, E266, E501, W503

[tool:pytest]
junit_family=legacy
addopts = -vvv -p no:logging --cov-report=term-missing --cov=elasticsearch --cov-config=.coveragerc
Copy link
Member Author

Choose a reason for hiding this comment

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

-p no:logging was breaking the caplog fixture now used in test_helpers.py by disabling logs capture.

@@ -619,8 +620,10 @@ async def test_no_scroll_id_fast_route(self, async_client, scan_teardown):
scroll_mock.assert_not_called()
clear_mock.assert_not_called()

@patch("elasticsearch._async.helpers.logger")
Copy link
Member Author

Choose a reason for hiding this comment

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

The @patch approach was failing on Python 3.7. I still don't know why but using caplog fixed the issue.

with patch.object(
async_client, "options", return_value=async_client
), patch.object(async_client, "scroll", MockScroll()):
try:
with pytest.raises(ScanError):
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a drive-by change: in addition to not failing when ScanError is raised, it fails if the exception is not raised.

@pquentin pquentin merged commit 5183a07 into elastic:main Nov 8, 2023
8 checks passed
Copy link

github-actions bot commented Nov 8, 2023

The backport to 8.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-8.10 8.10
# Navigate to the new working tree
cd .worktrees/backport-8.10
# Create a new branch
git switch --create backport-2367-to-8.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5183a07bed27ef1911320043bc0995eecacfa836
# Push it to GitHub
git push --set-upstream origin backport-2367-to-8.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-8.10

Then, create a pull request where the base branch is 8.10 and the compare/head branch is backport-2367-to-8.10.

@github-actions github-actions bot mentioned this pull request Nov 8, 2023
github-actions bot pushed a commit that referenced this pull request Nov 8, 2023
* Fix CI

(cherry picked from commit 5183a07)
@pquentin pquentin deleted the fix-ci branch November 8, 2023 06:52
pquentin added a commit that referenced this pull request Nov 8, 2023
* Fix CI (#2367)

Co-authored-by: Quentin Pradet <[email protected]>
pquentin added a commit that referenced this pull request Nov 8, 2023
* Fix CI

(cherry picked from commit 5183a07)
@pquentin
Copy link
Member Author

pquentin commented Nov 8, 2023

Backports:

pquentin added a commit that referenced this pull request Nov 9, 2023
* Fix CI

(cherry picked from commit 5183a07)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants