Skip to content

Add mariadb 10.3.32 to database tests#87741

Merged
bdraco merged 13 commits into
home-assistant:devfrom
epenet:mariadb-10.6.10
Feb 13, 2023
Merged

Add mariadb 10.3.32 to database tests#87741
bdraco merged 13 commits into
home-assistant:devfrom
epenet:mariadb-10.6.10

Conversation

@epenet
Copy link
Copy Markdown
Contributor

@epenet epenet commented Feb 8, 2023

Proposed change

  • add 10.3.32 (oldest supported version) to ensure more code branches are covered

cc @bdraco

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant home-assistant Bot added cla-signed code-quality small-pr PRs with less than 30 lines. labels Feb 8, 2023
Comment thread .github/workflows/ci.yaml Outdated
@epenet epenet changed the title Add mariadb 10.6.10 to recorder tests Adjust mariadb versions in recorder tests Feb 9, 2023
@frenck frenck marked this pull request as draft February 9, 2023 07:12
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Feb 9, 2023

CI is failing - will need to be rebased after #87760

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

It looks like the latest CI changes introduced an issue as the MariaDB/Postgresql tests should have run on

#87760
#87761
#87756

@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Feb 9, 2023

They wouldn't have run before either the CI changes.
Because you are only adjusting tests, it doesn't trigger "full" CI.

You can add a label "ci-full-run" to trigger full suite.

Edit: fixed in #87764

@epenet epenet changed the title Adjust mariadb versions in recorder tests Adjust mariadb versions in database tests Feb 9, 2023
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

We might have fixed it. Merged in dev to get a clean run. If it still fails on 10.3.x I'll need to dig more once everything else is cleaned up

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

Still failing

FAILED tests/components/recorder/test_purge.py::test_purge_many_old_events - assert 6 == 5
 +  where 6 = <bound method Query.count of <sqlalchemy.orm.query.Query object at 0x7f9bc0531990>>()
 +    where <bound method Query.count of <sqlalchemy.orm.query.Query object at 0x7f9bc0531990>> = <sqlalchemy.orm.query.Query object at 0x7f9bc0531990>.count

Thats a bit concerning as it implies it affects production

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

🤞 that the latest round of fixes take care of this. Otherwise its a deep dive with 10.3.x

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

Good news it it actually looks like a race and the new event is being recorded while the test is running

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 9, 2023

Looks like it isn't the problem I thought it was. Running out of steam though to dig into this more so may have to be tomorrow

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 10, 2023

Still haven't figured out what is going on here. Will try again after sleep

@epenet epenet mentioned this pull request Feb 13, 2023
19 tasks
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

Adding 10.3 might not be worth the effort since it goes eol in 3 months and 1 week

However I'm torn since there will probably still be a lot of synology users using it so it might still be worth it

@epenet epenet changed the title Adjust mariadb versions in database tests Add mariadb 10.3.32 to database tests Feb 13, 2023
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

I want to additional MySQL tests going and than will come back to this.

@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Feb 13, 2023

Sure thing - I just resolved the conflict with #87989 and adjusted the PR title/description.

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (recorder) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of recorder can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign recorder Removes the current integration label and assignees on the issue, add the integration domain after the command.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

docker run --detach -p 3307:3306 --name homeassistant-test --env MARIADB_USER=homeassistant-test --env MARIADB_PASSWORD=abcdef --env MARIADB_ROOT_PASSWORD=abcdef mariadb:10.3
python3 -X dev -m pytest -v --dburl=mysql://root:abcdef@127.0.0.1:3307/homeassistant-test tests/components/recorder/test_purge.py

Fails locally with the above

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

[<recorder.EventData(id=1, hash='2514025343', data='{"domain":"recorder","service":"purge"}')>,
 <recorder.EventData(id=2, hash='2001541813', data='{"domain":"recorder","service":"purge_entities"}')>,
 <recorder.EventData(id=3, hash='616907209', data='{"domain":"recorder","service":"enable"}')>,
 <recorder.EventData(id=4, hash='3478486156', data='{"domain":"recorder","service":"disable"}')>,
 <recorder.EventData(id=5, hash='3356717238', data='{"action":"create","domain":"recorder","issue_id":"maria_db_range_index_regression"}')>,
 <recorder.EventData(id=6, hash='2705000516', data='{"component":"recorder"}')>]

@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

This test is actually testing the wrong thing. There shouldn't be any event datas in this test. 🤦

Comment thread tests/components/recorder/test_purge.py
@bdraco bdraco marked this pull request as ready for review February 13, 2023 19:47
@bdraco bdraco requested a review from a team as a code owner February 13, 2023 19:47
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Feb 13, 2023

Merging in dev to make sure the new set of MariaDB tests also pass that I just merged

@bdraco bdraco merged commit efef915 into home-assistant:dev Feb 13, 2023
@epenet epenet deleted the mariadb-10.6.10 branch February 14, 2023 11:07
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants