You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/11/22 15:25:26 UTC

[GitHub] [trafficcontrol] rob05c commented on a change in pull request #6366: T3C remove extraneous logs

rob05c commented on a change in pull request #6366:
URL: https://github.com/apache/trafficcontrol/pull/6366#discussion_r754384024



##########
File path: cache-config/testing/ort-tests/config/config.go
##########
@@ -32,95 +32,143 @@ import (
 	"github.com/kelseyhightower/envconfig"
 )
 
-// Config reflects the structure of the test-to-api.conf file
+// Config reflects the structure of the test-to-api.conf file. It also
+// implements github.com/apache/trafficcontrol/lib/go-log.Config for logging.
 type Config struct {
 	TrafficOps   TrafficOps   `json:"trafficOps"`
 	TrafficOpsDB TrafficOpsDB `json:"trafficOpsDB"`
 	Default      Default      `json:"default"`
 	UseIMS       bool         `json:"use_ims"`
 }
 
-// TrafficOps - config section
+// TrafficOps is the section of a Config dealing with Traffic Ops-related
+// information.
 type TrafficOps struct {
-	// URL - The point to the Traffic Ops instance being tested
+	// URL is the URL of a Traffic Ops instance being used for the tests.
 	URL string `json:"URL" envconfig:"TO_URL"`
 
-	// UserPassword - The Traffic Ops test user password hitting the API
+	// UserPassword is the password of *all* users in the 'Users' property.
 	UserPassword string `json:"password" envconfig:"TO_USER_PASSWORD"`
 
-	// User - The Traffic Ops Users
+	// Users are the Traffic Ops users to be used in testing.
 	Users Users `json:"users"`
 
-	// Insecure - ignores insecure ssls certs that were self-generated
+	// Insecure instructs tests whether or not to skip certificate verification.
 	Insecure bool `json:"sslInsecure" envconfig:"SSL_INSECURE"`
 }
 
-// Users "users" section of the test-to-api.conf file
+// Users structures are the "users" section of the "trafficOps" section of the
+// testing configuration file, and are a collection of the usernames of  Traffic
+// Ops users that are used in testing.
 type Users struct {
 
-	// DisallowedUser - The Traffic Ops Disallowed user
+	// Disallowed is the username of a "disallowed" Traffic Ops user.
+	//
+	// Deprecated: This is unused in t3c tests, and may be removed in the
+	// future.
 	Disallowed string `json:"disallowed" envconfig:"TO_USER_DISALLOWED"`
 
-	// ReadOnly - The Traffic Ops Read Only user
+	// ReadOnly is the username of a Traffic Ops user with "read-only"
+	// Permissions.
+	//
+	// Deprecated: This is unused in t3c tests, and may be removed in the
+	// future.
 	ReadOnly string `json:"readOnly" envconfig:"TO_USER_READ_ONLY"`
 
-	// Operations - The Traffic Ops Operations user
+	// Operations is the username of a Traffic Ops user with "operations"-level
+	// Permissions.
+	//
+	// Deprecated: This is unused in t3c tests, and may be removed in the
+	// future.
 	Operations string `json:"operations" envconfig:"TO_USER_OPERATIONS"`
 
-	// AdminUser - The Traffic Ops Admin user
+	// Admin is the username of a Traffic Ops user with the special "admin"
+	// Role.
 	Admin string `json:"admin" envconfig:"TO_USER_ADMIN"`
 
-	// PortalUser - The Traffic Ops Portal user
+	// Portal is the username of a Traffic Ops user with "portal"-level
+	// Permissions.
+	//
+	// Deprecated: This is unused in t3c tests, and may be removed in the
+	// future.
 	Portal string `json:"portal" envconfig:"TO_USER_PORTAL"`
 
-	// FederationUser - The Traffic Ops Federation user
+	// Federation is the username of a Traffic Ops user with
+	// "federation"-level Permissions.
+	//
+	// Deprecated: This is unused in t3c tests, and may be removed in the
+	// future.
 	Federation string `json:"federation" envconfig:"TO_USER_FEDERATION"`
 
-	// Extension - The Traffic Ops Extension user
+	// Extension is the username of a Traffic Ops user allowed to manipulate
+	// extensions (i.e. creating new serverchecks).
+	//
+	// These tests currently use Traffic Ops API version 3.0, so the only
+	// username that can possibly work is literally "extension". This property
+	// MUST be configured to be "extension", or the tests will erroneously fail,
+	// no matter what "Priv Level" and/or Permissions you give the user!
 	Extension string `json:"extension" envconfig:"TO_USER_EXTENSION"`
 }
 
-// TrafficOpsDB - config section
+// TrafficOpsDB is the section of a Config dealing with Traffic Ops DB-related
+// information.
 type TrafficOpsDB struct {
-	// Name - Traffic Ops Database name where the test data will be setup
+	// Name is the name of a PostgreSQL database used by the testing Traffic Ops
+	// instance.
 	Name string `json:"dbname" envconfig:"TODB_NAME"`
 
-	// Hostname - Traffic Ops Database hostname where Postgres is running
+	// Hostname is the network hostname where the Traffic Ops database is
+	// running.
 	Hostname string `json:"hostname" envconfig:"TODB_HOSTNAME"`
 
-	// User - database user that Traffic Ops is using to point to the 'to_test' database
+	// User is the name of a PostgreSQL user/role that has permissions to
+	// manipulate the database identified in Name.
 	User string `json:"user" envconfig:"TODB_USER"`
 
-	// Password - database password for the User above
+	// Password is the password for the PostgreSQL user/role given in User.
 	Password string `json:"password" envconfig:"TODB_PASSWORD"`
 
-	// Port - Postgres port running that has the to_test schema
+	// Port is the port on which PostgreSQL listens for connections to the
+	// database used by the testing Traffic Ops instance.
 	Port string `json:"port" envconfig:"TODB_PORT"`
 
-	// DBType - will be 'Pg' by default but tells the Golang database driver
-	//          the database type
+	// DBType is a Go database/sql driver name to use when connecting to the
+	// Traffic Ops testing instance's database. This MUST be "Pg" (or
+	// omitted/blank/null, which uses the default value of "Pg").
+	//
+	// Deprecated: Since Traffic Ops 3.0, only PostgreSQL databases are
+	// supported, so this field has no purpose and will probably be removed at
+	// some point.
 	DBType string `json:"type" envconfig:"TODB_TYPE"`
 
-	// SSL - Flag that tells the database driver that the Postgres instances has TLS enabled
+	// SSL instructs the database driver that the PostgreSQL instance used by
+	// the tests requires SSL-secured connections.
 	SSL bool `json:"ssl" envconfig:"TODB_SSL"`
 
-	// Description - database description
+	// Description is a textual description of the database.
+	//
+	// Deprecated: This unused field serves no purpose, and will likely be
+	// removed in the future.
 	Description string `json:"description" envconfig:"TODB_DESCRIPTION"`
 }
 
-// Default - config section
+// Default represents the default values of a set of options that can be
+// overridden by command-line options.
 type Default struct {
-	Session            Session   `json:"session"`
-	Log                Locations `json:"logLocations"`
-	IncludeSystemTests bool      `json:"includeSystemTests"`
+	Session Session   `json:"session"`
+	Log     Locations `json:"logLocations"`
+	// Deprecated: This field has no effect or known purpose.

Review comment:
       Did you mean to make this not follow to GoDoc? (A complete sentence starting with the symbol name.)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org