ants-publish

command
v0.0.0-...-cd06882 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause Imports: 3 Imported by: 0

README

ants-publish

Design doc

go/ants-publish

Testing services

ants-publish (CLI)

All provided paths should absolute paths.

 ants-publish$ go build .
 ants-publish$ ./ants-publish cli -input ./testdata/publishrequest.json -output <desired_output_file_path> -log-path <desired_log_path>

By default, it uses /tmp/ants-publish/ to log all messages. -log-path var can be used to point it to another location.

ants-publish (Server)

Start ants-publish server

 ants-publish$ go build .
 ants-publish$ ./ants-publish server --port <port_number>
server_command.go: running server mode:
ants_publish_server.go: ants-publish-service listen to request at  [::]:44349

Examples: port_number = 44349 (Provide 0 if we want to start the server on a random available port)

Once the server has started, you may use grpc_cli to interact with the services. Example:

$ grpc_cli ls localhost:44349 chromiumos.test.api.GenericPublishService --channel_creds_type insecure
Publish
Publish

Create key.json file in the same folder(ants-publish) where the binary lives. This file should have the GCS credentials that will be used for GCS upload. This info will be made part of the input soon and will be expected to provide this as part of input.

$ grpc_cli call localhost:38869 chromiumos.test.api.GenericPublishService.Publish --infile=input.textproto --channel_creds_type insecure
connecting to localhost:44349
name: "operations/655953d1-968f-4e61-96c8-8929c53c002a"
done: true
response {
  type_url: "type.googleapis.com/chromiumos.test.api.PublishResponse"
}
Rpc succeeded with OK status

Examples:

  1. input.textproto = http://go/paste/6585018561331200 (Please modify the aritifact_dir_path.path and gcs_path.path correctly)
  2. More examples are included in the examples folder.
ants-publish (testing)

This only allows us to read from Ants. Writing to Ants is restricted to service accounts and bots only and cannot be replicated locally. There is a way to impersonate a service account locally, but is currently not supported.

 ants-publish$ go build .
 ants-publish$ ./ants-publish test -invocation-id "I123456" -workunit-id "WU123456" -testresult-id 1234

This will print out the details for invocation, workunit or test result accordingly. You can choose to get details for one or all three. If invocation id is not empty, along with invocation details, it will also print out all the work units and test results associated with that invocation.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package cli represents commands to run for ants-publish.
Package cli represents commands to run for ants-publish.
Package server implements a GRPC Server.
Package server implements a GRPC Server.
Package service provides the API handlers for ants publish.
Package service provides the API handlers for ants publish.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL