gokulakrishnansvm commented on code in PR #7400:
URL: https://github.com/apache/trafficcontrol/pull/7400#discussion_r1142559037


##########
traffic_ops/testing/api_contract/README.md:
##########
@@ -0,0 +1,74 @@
+# Traffic Ops API Contract Tests
+
+The Traffic Ops API Contract tests are used to validate the Traffic Ops API's.
+
+## Setup
+
+In order to run the tests you will need a running instance of Traffic Ops and 
Traffic Ops DB:
+
+1. **Traffic Ops Database** configured port access
+    - _Usually 5432 - should match the value set in database.conf and the 
**trafficOpsDB port** in traffic-ops-test.conf_
+2. **Traffic Ops** configured port access
+    - _Usually 443 or 60443 - should match the value set in cdn.conf and the 
**URL** in traffic-ops-test.conf_
+3. Running Postgres instance with a database that matches the **trafficOpsDB 
dbname** value set in traffic-ops-test.conf
+    - For example to set up the `to_test` database do the following:
+
+         ```console
+         $ cd trafficcontrol/traffic_ops/app
+         $ db/admin --env=test reset
+         ```
+
+      The Traffic Ops users will be created by the tool for accessing the API 
once the database is accessible.
+
+      To test if `db/admin` ran all migrations successfully, you can run the 
following command from the `traffic_ops/app` directory:
+
+        ```console
+        db/admin -env=test dbversion
+        ```
+      The result should be something similar to:
+        ```
+        dbversion 2021070800000000
+        ```
+      If migrations did not run successfully, you may see:
+        ```
+        dbversion 20181206000000 (dirty)
+        ```
+      Make sure **trafficOpsDB dbname** in traffic-ops-test.conf is set to: 
`to_test`
+
+      For more info see: 
http://trafficcontrol.apache.org/docs/latest/development/traffic_ops.html?highlight=reset
+
+4. A running Traffic Ops Golang instance pointing to the `to_test` database.
+
+    ```console
+       $ cd trafficcontrol/traffic_ops/traffic_ops_golang
+    $ cp ../app/conf/cdn.conf $HOME/cdn.conf 
+    $ go build && ./traffic_ops_golang -cfg $HOME/cdn.conf -dbcfg 
../app/conf/test/database.conf
+    ```
+   Verify that the passwords defined for your `to_test` database match:
+    - `trafficcontrol/traffic_ops/app/conf/test/database.conf`
+    - `traffic-ops-test.conf`
+
+5. Install the requirements for testing API contract tests
+
+    ```console
+    pip install -r /path/to/requirements.txt
+    ``` 
+
+## Running the API Contract Tests
+
+The API Contract tests are run using `pytest` from the 
**traffic_ops/testing/api_contract/v4** directory

Review Comment:
   Changed file paths from bold to mono space.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to