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

Validate XTCE output #33

Merged
merged 1 commit into from
Jul 14, 2024
Merged

Validate XTCE output #33

merged 1 commit into from
Jul 14, 2024

Conversation

ThirteenFish
Copy link
Contributor

Adds a test that will validate the generated oresat xtce against the official xtce schema. This caught three minor issues in our generator:

  • The root name attribute doesn't like dots in its string. 63f8766 broke this when refactoring the mission names, this restores the old behavior.
  • The XML namespace was incorrect. It pointed to the old version of XTCE which had been changed in the new schema. It also required xtce to be the prefix for every tag, which we weren't doing. Dropping it means the whole document is assumed to be in that namespace so we don't have to go through the hassle of prefixing every tag.
  • Encodings -> Encoding.

The schema check in CI could be more elegant, I've just hardcoded both fetching the schema and the output file for now but they probably should be determined dynamically eventually.

Adds a test that will validate the generated oresat xtce against the
official xtce schema. This caught three minor issues in our generator:
- The root `name` attribute doesn't like dots in its string. 63f8766
  broke this when refactoring the mission names, this restores the old
  behavior.
- The XML namespace was incorrect. It pointed to the old version of XTCE
  which had been changed in the new schema. It also required `xtce` to
  be the prefix for every tag, which we weren't doing. Dropping it means
  the whole document is assumed to be in that namespace so we don't have
  to go through the hassle of prefixing every tag.
- Encodings -> Encoding.

The schema check in CI could be more elegant, I've just hardcoded both
fetching the schema and the output file for now but they probably should
be determined dynamically eventually.
Copy link
Member

@ryanpdx ryanpdx left a comment

Choose a reason for hiding this comment

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

This is great

@ryanpdx ryanpdx merged commit 5902436 into master Jul 14, 2024
1 check passed
@ryanpdx ryanpdx deleted the xsd-validate branch July 14, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants