Repository navigation
[Better Tests] Add GCE metadata emulator worker/uworker configs #5485
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
IvanBM18
merged 4 commits into
better-tests/01-compute-metadata-host
from
better-tests/01a-metadata-emulator-configs
Oct 6, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b3edeb5
[Better Tests] Add GCE metadata emulator worker fixtures
IvanBM18 64c1ec5
[Better tests] Defaults uworker to non pre-emtible bot
IvanBM18 580fe26
[Better tests] Moves location of configs
IvanBM18 2c93536
[Better tests] Scheduling is now STANDARD for uworkers
IvanBM18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| { | ||
| // Reference metadata emulator config. Copy this file to create a fixture, | ||
| // stripping "//" comments so standard encoding/json can parse it. | ||
| // | ||
| // The shape of "metadata" mirrors the GCE metadata server's hierarchy: | ||
| // | ||
| // curl -H 'Metadata-Flavor: Google' \ | ||
| // 'http://metadata.google.internal/computeMetadata/v1/?recursive=true' \ | ||
| // | jq | ||
|
|
||
| "credentials": { | ||
| // Identity and token reported under instance/service-accounts/. | ||
| // No network, no gcloud, no real credentials. | ||
| "email": "", | ||
| "scopes": [], | ||
| "access_token": "", | ||
| "expires_in_seconds": 3600 | ||
| }, | ||
|
|
||
| "host": { | ||
| "interface": "127.0.0.1" | ||
| }, | ||
|
|
||
| "metadata": { | ||
| "project": { | ||
| "project-id": "", | ||
| "numeric-project-id": "", | ||
|
|
||
| // Project-wide custom metadata, served under project/attributes/<key>. | ||
| // Applies to every instance in the project. | ||
| "attributes": { | ||
| "deployment-bucket": "test-deployment" | ||
| } | ||
| }, | ||
|
|
||
| "instance": { | ||
| "id": "", | ||
| "hostname": "", | ||
|
|
||
| // Write the zone the way the real metadata server does: as a full | ||
| // resource path, not just the zone name. | ||
| // | ||
| // do this: "projects/1234567890/zones/us-central1-f" | ||
| // not this: "us-central1-f" | ||
| "zone": "", | ||
|
|
||
| "machine-type": "", | ||
| "preempted": "FALSE", | ||
| "scheduling": { | ||
| "preemptible": "FALSE", | ||
| "provisioning-model": "STANDARD" | ||
| }, | ||
|
|
||
| // Per-instance custom metadata, served under instance/attributes/<key>. | ||
| // An instance attribute shadows a project attribute of the same name. If | ||
| // neither scope defines the key the server returns 404, which some | ||
| // callers treat as a meaningful answer rather than an error. | ||
| "attributes": { | ||
| "override_tworker_queue": "jobs-linux-test" | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| { | ||
| "credentials": { | ||
| "email": "test-clusterfuzz-service-account-email", | ||
| "scopes": [ | ||
| "https://www.googleapis.com/auth/cloud-platform", | ||
| "https://www.googleapis.com/auth/userinfo.email" | ||
| ], | ||
| "access_token": "fake-tworker-access-token", | ||
| "expires_in_seconds": 3600 | ||
| }, | ||
| "host": { | ||
| "interface": "127.0.0.1" | ||
| }, | ||
| "metadata": { | ||
| "project": { | ||
| "project-id": "test-clusterfuzz", | ||
| "numeric-project-id": "1234567890", | ||
| "attributes": { | ||
| "deployment-bucket": "test-deployment-bucket", | ||
| "deployment-zip": "linux-3.zip" | ||
| } | ||
| }, | ||
| "instance": { | ||
| "id": "1111111111111111111", | ||
| "hostname": "tworker-1.c.test-clusterfuzz.internal", | ||
| "zone": "projects/1234567890/zones/us-central1-f", | ||
| "preempted": "FALSE", | ||
| "scheduling": { | ||
| "preemptible": "FALSE", | ||
| "provisioning-model": "STANDARD" | ||
| }, | ||
| "attributes": { | ||
| "override_tworker_queue": "jobs-linux-test" | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "credentials": { | ||
| "email": "test-unpriv-clusterfuzz-service-account-email", | ||
| "scopes": ["https://www.googleapis.com/auth/cloud-platform"], | ||
| "access_token": "fake-uworker-access-token", | ||
| "expires_in_seconds": 3600 | ||
| }, | ||
| "host": { | ||
| "interface": "127.0.0.1" | ||
| }, | ||
| "metadata": { | ||
| "project": { | ||
| "project-id": "test-clusterfuzz", | ||
| "numeric-project-id": "1234567890", | ||
| "attributes": { | ||
| "deployment-bucket": "test-deployment-bucket", | ||
| "deployment-zip": "linux-3.zip" | ||
| } | ||
| }, | ||
| "instance": { | ||
| "id": "2222222222222222222", | ||
| "hostname": "uworker-1.c.test-clusterfuzz.internal", | ||
| "zone": "projects/1234567890/zones/us-central1-f", | ||
| "preempted": "FALSE", | ||
| "scheduling": { | ||
| "preemptible": "FALSE", | ||
| "provisioning-model": "STANDARD" | ||
| }, | ||
| "attributes": {} | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.