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 failure to raise on bad YAML syntax from include files #75510

Merged
merged 6 commits into from
Jul 20, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jul 20, 2022

Note that the CI is failing because the test fixture has bad yaml. We want to keep that

Proposed change

  • The test was mocking out the underlying object so it
    came in as StringIO instead of TextIOWrapper. To resolve
    this another test was added that uses an actual file
    on disk so we have a better end to end test

Fixes #75374 Fixes #74806 Fixes #75006 Fixes #75070

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.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

- The test was mocking out the underlying object so it
  came in as StringIO instead of TextIOWrapper. To resolve
  this another test was added that uses an actual file
  on disk so we have a better end to end test
@bdraco bdraco added this to the 2022.7.6 milestone Jul 20, 2022
@bdraco bdraco requested a review from a team as a code owner July 20, 2022 14:50
@bdraco bdraco mentioned this pull request Jul 20, 2022
tests/util/yaml/fixtures/bad.yaml Outdated Show resolved Hide resolved
tests/util/yaml/fixtures/bad.yaml Outdated Show resolved Hide resolved
@bdraco
Copy link
Member Author

bdraco commented Jul 20, 2022

The linter is trying to hard here. I ended up renaming it to .yaml.txt to side step that since its never going to be valid

@frenck
Copy link
Member

frenck commented Jul 20, 2022

That will do as well I guess 🤷

@frenck frenck merged commit 48e82ff into home-assistant:dev Jul 20, 2022
@bdraco bdraco deleted the fix_failure_to_raise_on_by_syntax branch July 20, 2022 17:25
frenck added a commit that referenced this pull request Jul 20, 2022
@frenck frenck mentioned this pull request Jul 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.