commit | 5f0e1e9a35db187362f5158eac9267721ec74624 | [log] [tgz] |
---|---|---|
author | Kevin Chowski <chowski@google.com> | Fri Mar 19 15:26:04 2021 |
committer | LUCI CQ <infra-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Mar 19 15:26:04 2021 |
tree | e93ba89726d17b2a6cffdecf6f880b341aa2f071 | |
parent | 402d1a9b3dcf51f93d433a6325a67a83cb2f881a [diff] |
Pinpoint: first stab at a fake Legacy Pinpoint implementation. Just the bare-bones of functionality: you can preload job data, and call the `/api/job/$ID` API. JSON data is served by applying the in-memory representation of a Job to a text template. The single example JSON template (job.tmpl) was copied from the testdata of the gRPC server. If needed, the process of gathering example data for faking out can be automated more in the future. To test this, instead of duplicating the Legacy API constraints again, I thought we might be able to get away with reusing the new Pinpoint service as a controller; definitely channeling "prefer real objects" here. Advice on better/additional ways to test this would be welcome. This CL also moved some flags defined at package-scope into the Main function, to avoid flag pollution in the fakelegacy_test which imports that package. Change-Id: I50c1e0ea4f2e2a2cfbf8ee286715f01918a88b10 Reviewed-on: https://chromium-review.googlesource.com/c/infra/infra/+/2769286 Commit-Queue: Kevin Chowski <chowski@google.com> Reviewed-by: Dean Berris <dberris@chromium.org> Cr-Commit-Position: refs/heads/master@{#39533}
Testing Welcome to the Chrome Infra repository!
Wondering where to start? Check out General Chrome Infrastructure documentation. In particular, to check out this repo and the rest of the infrastructure code, follow the instructions here. The rest of this page is specific to this repo.
sys.path
modifications.from infra.path_hacks.common import <stg>
is actually getting <stg>
from build/scripts/common.git push origin <updated hash>:deployed
git push
commandIf you've added a new module, run your tests with test.py:
*_test.py
files to this directory.Double-check that your tests are getting picked up when you want them to be: ./test.py test <path-to-package>
.
Tests still not getting picked up by test.py? Double-check to make sure you have __init__.py
files in each directory of your module so Python recognizes it as a package.
The preferred style is PEP8 with two-space indent; that is, the Chromium Python style, except functions use lowercase_with_underscores
. Use yapf (git cl format
) to autoformat new code.