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

chore(internal/kokoro): skip submodules repeated test if root directoy is already pushd #10265

Merged
merged 5 commits into from
May 28, 2024

Conversation

rahul2393
Copy link
Contributor

@rahul2393 rahul2393 commented May 25, 2024

In #10251 there are repeated tests which internal/kokoro/presubmit.sh bash script was running.

Example:

CHANGED_DIRS='.
aiplatform
dlp
internal
managedkafka
spanner
video'

will run test twice for spanner once with "pushd ./spanner" and other with "pushd spanner"

We don't really need to run the sub-directories test if changes were detected in root directory(".") since it will anyways run all the tests in submodules.

@rahul2393 rahul2393 requested a review from a team as a code owner May 25, 2024 07:01
@rahul2393 rahul2393 requested review from codyoss and noahdietz May 25, 2024 07:01
@noahdietz
Copy link
Contributor

I'm not sure a change to a file in the top-dir (e.g. doc.go) should trigger tests in all submodules. This is a good call out though, I think we need to instead run tests in . directly but not ./... from the top, if that makes sense e.g. go test .. There are no tests in the top but I suppose it will still build the code...WDYT?

@codyoss
Copy link
Member

codyoss commented May 28, 2024

./... is a module aware command and should only run in the scope of a module

@rahul2393
Copy link
Contributor Author

rahul2393 commented May 28, 2024

@codyoss Thanks, can you please help find why did it ran tests twice on submodules? https://btx.cloud.google.com/invocations/de35c87c-677f-4eb7-9a48-4a7e77a94952/targets/cloud-devrel%2Fclient-libraries%2Fgo%2Fgoogle-cloud-go%2Fpresubmit%2Fearliest-version/log (I found the reason, in next comment)

@rahul2393
Copy link
Contributor Author

find "$d" -name go.mod
is returning all the submodules, example output of find "." -name go.mod

./dataflow/go.mod
./maps/go.mod
./resourcemanager/go.mod
./essentialcontacts/go.mod
./commerce/go.mod
./orgpolicy/go.mod
./workstations/go.mod
./webrisk/go.mod
./datastream/go.mod
./binaryauthorization/go.mod
./servicehealth/go.mod
./apigeeregistry/go.mod
./beyondcorp/go.mod
./kms/go.mod
./confidentialcomputing/go.mod
./resourcesettings/go.mod
./video/go.mod
./netapp/go.mod
./aiplatform/go.mod
./discoveryengine/go.mod
./go.mod
./servicemanagement/go.mod
./shopping/go.mod
./domains/go.mod
./vpcaccess/go.mod
./trace/go.mod
./bigtable/go.mod
./oslogin/go.mod
./gkehub/go.mod
./securityposture/go.mod
./gkeconnect/go.mod
./networkmanagement/go.mod
./identitytoolkit/go.mod
./asset/go.mod
./securitycenter/go.mod
./chat/go.mod
./apphub/go.mod
./dialogflow/go.mod
./storageinsights/go.mod
./rapidmigrationassessment/go.mod
./documentai/go.mod
...

Hence the issue

@rahul2393 rahul2393 force-pushed the presubmit-optimizations branch 2 times, most recently from 43c1296 to 6cee763 Compare May 28, 2024 17:42
@rahul2393 rahul2393 force-pushed the presubmit-optimizations branch from 6cee763 to 95a0916 Compare May 28, 2024 17:54
@rahul2393 rahul2393 enabled auto-merge (squash) May 28, 2024 18:04
@rahul2393 rahul2393 merged commit 08e9345 into main May 28, 2024
11 checks passed
@rahul2393 rahul2393 deleted the presubmit-optimizations branch May 28, 2024 19:48
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.

3 participants