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

Add GHA to run TeamCity config tests on PRs editing .teamcity #9954

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

SarahFrench
Copy link
Contributor

Closes hashicorp/terraform-provider-google#17231

Release Note Template for Downstream PRs (will be copied)


@SarahFrench SarahFrench requested a review from a team as a code owner February 9, 2024 12:09
@SarahFrench SarahFrench requested review from shuyama1 and removed request for a team February 9, 2024 12:09
Comment on lines +45 to +46
make test
make test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know the exact reason why, but if you only run this command once the tests aren't detected and the test runner reports [INFO] No tests to run.:

Screenshot 2024-02-09 at 12 13 42

Instead the logs should show something like this:

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running tests.NightlyTestProjectsTests
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.164 s - in tests.NightlyTestProjectsTests
[INFO] Running tests.BuildConfigurationFeatureTests
[INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.032 s - in tests.BuildConfigurationFeatureTests
[INFO] Running tests.ContextParameterHandlingTests
[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.144 s - in tests.ContextParameterHandlingTests
[INFO] Running tests.VcsTests
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in tests.VcsTests
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can see the TESTS output in the GHA run for 1bf8b76 in this line here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the basis of this behaviour is the pom.xml file, maybe this section, but I'm really not an experienced Kotlin/Java developer. Given that the pom.xml file we use strongly resembles the Azure provider team's pom.xml file, who are the SMEs for TeamCity in HashiCorp, I'd like to avoid digging into this solo.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, but it works fine locally, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It behaves the same way locally if I make my laptop's state match a GHA running in a fresh container. I do that by deleting the (gitignored) mmv1/third_party/terraform/.teamcity/target folder from my local copy of MM, a folder made in the process of running make test.

If I run make test after deleting the target folder the target folder is remade and populated and then I see the 'No tests to run' message. If I run make test a second time, when target is present from the first run, I see the expected test pass/fail output.

It's very weird but at least shows it's not a problem with GHAs vs using these files during development.

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@SarahFrench
Copy link
Contributor Author

@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Sorry, missed this from my review list somehow

@SarahFrench
Copy link
Contributor Author

Sorry, missed this from my review list somehow

No problem, this PR wasn't urgent and given the review request changes I decided not to ping you. Thanks for the review!

@SarahFrench SarahFrench merged commit 0c871aa into main Feb 16, 2024
12 checks passed
tdbhacks pushed a commit to tdbhacks/magic-modules that referenced this pull request Feb 23, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
Charlesleonius pushed a commit to Charlesleonius/magic-modules that referenced this pull request Feb 29, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Mar 6, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
Charlesleonius pushed a commit to Charlesleonius/magic-modules that referenced this pull request Mar 11, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
@SarahFrench SarahFrench deleted the teamcity-automate-tests-on-prs branch March 19, 2024 21:59
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request Apr 19, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
balanaguharsha pushed a commit to balanaguharsha/magic-modules that referenced this pull request May 2, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
pengq-google pushed a commit to pengq-google/magic-modules that referenced this pull request May 21, 2024
…leCloudPlatform#9954)

* Add GHA to run TeamCity config tests on PRs editing `.teamcity`

* Push failing test to check GHA detects it

* Remove intentionally failing test
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.

TeamCity: Add GHAs to run the TeamCity configuration's tests on PRs editing the TeamCity configuration
3 participants