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

TeamCity: test utils refactor #18113

Conversation

modular-magician
Copy link
Collaborator

This PR:

  • updates the test utils used in the tests for the TeamCity config code.
  • changes error messages to be framed the correct way

Test utils:

Previously there was a getSubProject function that would retrieve a project that was nested 2 levels deep from a starting project. It was always given the root of the TeamCity project and was used to pull out projects from within the Google or Google Beta projects.

Now, getSubProject does something more logical given its name. You supply a Project and the name of a subproject within it, and it'll return a Project object for that subproject. This can be used to make assertions on, etc.

The original functionality of retrieving a project from 2 levels of nesting is now fulfilled by getNestedProjectFromRoot, which uses getSubProject internally.

This PR refactors existing acceptance tests to use the new test utils.

Error message framing

Messages needed to be rewritten to be pointing out why a given test would fail.


Release Note Template for Downstream PRs (will be copied)


Derived from GoogleCloudPlatform/magic-modules#10290

[upstream:998f8f9a5f175b77363c9a22020f032b919eb391]

Signed-off-by: Modular Magician <magic-modules@google.com>
@modular-magician modular-magician merged commit eb6830b into hashicorp:main May 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant