Skip to content

Conversation

@gmechali
Copy link
Contributor

@gmechali gmechali commented Dec 1, 2025

Refactors the Website Cron Tests to allow them to run in a mode that returns a success/failure.
This also parallelizes the sanity, adversarial and nodejs query tests.
We also modified the adversarial tests to allow sampling so we can run on a subset of the 12k+ queries.

This work now enables us to link the website cron tests to our Cloud Deploy pipeline. Here's how I made it work:

  • Website Dev pipeline will always run sanity tests, nodejs query tests after every release, and adversarial tests on 1% of queries. It's done deploying after the tests are done.
  • Website pipeline:
    • In Autopush, runs all sanity + nodejs tests, and adversarial tests at 1% sample synchronously.
    • In Staging, runs all sanity tests and adversarial on 100% of queries ASYNC. It will be done deploying after it triggered the test run.
    • In Production, same as staging.

@gmechali gmechali requested a review from dwnoble December 4, 2025 18:43
@gmechali gmechali marked this pull request as ready for review December 4, 2025 19:06
Copy link
Contributor

@dwnoble dwnoble left a comment

Choose a reason for hiding this comment

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

Maybe for a future PR, but can we also deprecate:

build/website_cron_testing/Dockerfile
build/ci/cloudbuild.website_testing.yaml (and the related cloud build trigger)

rm -rf ./output/*
}

echo "Starting tests in parallel..."
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of starting the tests in parallel in the same step, can we start them in 3 separate steps that cloud build runs in parallel? I think it will be easier to debug and dig through the logs if they're running in separate steps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So there's a big argument for keeping them in the same one. Post deploy hooks are run sequentially which then means it would run nodejs, sanity and adv tests one after another making it WAY longer.

I think the extra logging I added in this script make it easy-ish to sift through the logs though I do agree it would have been better as separate steps :). I tried but I think the lack of parallelization among post-deploy hooks makes it worth keeping them in the same build. Do you agree?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can't the cloudbuild.cron_tests.yaml start the jobs in parallel though? Using something like example on this page: https://docs.cloud.google.com/build/docs/configuring-builds/configure-build-step-order - (i could be misunderstanding the example though)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yes you're right! The only downside then is the cloud deploy pipeline's logs wont show the tests running but it will show a link to the other cloud build action, which then has the tests running. That's probably fine!
mind if we submit as is, and I ll send a follow up to take it out once ive verified it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm it's done :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Thanks @gmechali

last nit: remove the echo "Starting tests in parallel..." line

@gmechali
Copy link
Contributor Author

gmechali commented Dec 5, 2025

Maybe for a future PR, but can we also deprecate:

build/website_cron_testing/Dockerfile
build/ci/cloudbuild.website_testing.yaml (and the related cloud build trigger)

Yes will leave this for a follow up!

@gmechali gmechali requested a review from dwnoble December 5, 2025 02:40
rm -rf ./output/*
}

echo "Starting tests in parallel..."
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! Thanks @gmechali

last nit: remove the echo "Starting tests in parallel..." line

args:
- "-c"
- |
gcloud builds submit --config build/website_cron_testing/cloudbuild.cron_tests.yaml \
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this kicked off as a gcloud builds submit whereas as autopush and dev are ./run_website_cron_tests.sh?

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