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 2022/02/28 16:19:50 UTC
[GitHub] [trafficcontrol] zrhoffman opened a new pull request #6588: TR Utlimate Test Harness GHA workflow
zrhoffman opened a new pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588
<!--
Thank you for contributing! Please be sure to read our contribution guidelines: https://github.com/apache/trafficcontrol/blob/master/CONTRIBUTING.md
If this closes or relates to an existing issue, please reference it using one of the following:
Closes: #ISSUE
Related: #ISSUE
If this PR fixes a security vulnerability, DO NOT submit! Instead, contact
the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://apache.org/security regarding vulnerability disclosure.
-->
This PR adds a GitHub Actions workflow for the Traffic Router Ultimate Test Harness, which runs when Traffic Router-related files are modified.
<!-- **^ Add meaningful description above** --><hr/>
## Which Traffic Control components are affected by this PR?
<!-- Please delete all components from this list that are NOT affected by this PR.
Feel free to add the name of a tool or script that is affected but not on the list.
-->
- Dev CDN in a Box
- Automation - GitHub Actions<!-- Please specify which (GitHub Actions, Docker images, Ansible Roles, etc.) -->
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your PR.
If your PR has tests (and most should), provide the steps needed to run the tests.
If not, please provide step-by-step instructions to test the PR manually and explain why your PR does not need tests. -->
Check the GHA result
## PR submission checklist
- [x] This PR has tests <!-- If not, please delete this text and explain why this PR does not need tests. -->
- [ ] This PR has documentation <!-- If not, please delete this text and explain why this PR does not need documentation. -->
- [ ] This PR has a CHANGELOG.md entry <!-- A fix for a bug from an ATC release, an improvement, or a new feature should have a changelog entry. -->
- [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://apache.org/security) for details)
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
--
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
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1054652851
Rebased to remove cb4b4247c8as, as it is already covered by #6591
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r816245255
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
+
+# Log in
+login_body="$(<<<{} jq --arg TO_USER "$TO_USER" --arg TO_PASSWORD "$TO_PASSWORD" '.u = $TO_USER | .p = $TO_PASSWORD')"
+to-req /user/login --data "$login_body"
+
+declare -A service_by_hostname
+service_by_hostname[trafficrouter]=trafficrouter
+service_by_hostname[edge]=t3c
+
+for hostname in trafficrouter edge; do
+ container_id="$(docker-compose ps -q "${service_by_hostname[$hostname]}")"
+ interface="$(<<'JSON' jq
+ {
+ "mtu": 1500,
+ "monitor": true,
+ "ipAddresses": [],
+ "name": "eth0"
+ }
+JSON
+ )"
+ for ip_address_field in IPv4Address IPv6Address; do
+ ip_address="$(docker network inspect dev.ciab.test |
+ jq -r --arg TR_CONTAINER_ID "$container_id" --arg IP_ADDRESS_FIELD "$ip_address_field" '.[0].Containers[$TR_CONTAINER_ID][$IP_ADDRESS_FIELD]')"
+ interface="$(<<<"$interface" jq --arg IP_ADDRESS "$ip_address" '.ipAddresses += [{} | .address = $IP_ADDRESS | .serviceAddress = true]')"
+ done
+
+
+ # Get Traffic Router server JSON
+ server="$(to-req "/servers?hostName=${hostname}" | jq '.response[0]')"
+ if [[ -z "$server" ]]; then
+ echo "Could not get JSON for server ${hostname}"
+ exit 1
+ fi
+
+ # Update Traffic Router's interface with its IP addresses
+ server="$(<<<"$server" jq ".interfaces = [${interface}]")"
+ server_id="$(<<<"$server" jq .id)"
+ if ! to-req "/servers/${server_id}" --request PUT --data "$server"; then
+ echo "Could not update server ${hostname} with ${server}"
+ fi
+done
+
+# Snapshot
+cdn_id="$(<<<"$server" jq .cdnId)"
+to-req "/snapshot?cdnID=${cdn_id}" --request PUT
+
+http_result=0 dns_result=0
+# Compile the tests
+go test -c ./traffic_router/ultimate-test-harness
+if ! ./ultimate-test-harness.test -test.v -test.run=^TestHTTPLoad$ -http_requests_threshold=5000; then
+ http_result=1
+fi
+
+if ! ./ultimate-test-harness.test -test.v -test.run=^TestDNSLoad$ -dns_requests_threshold=20500; then
+ dns_result=1
+fi
+if [[ $http_result -eq 0 && $dns_result -eq 0 ]]; then echo
+ echo Tests passed!
+else
+ echo Tests failed!
Review comment:
Exiting with a non-zero code on failure in f016b73b68
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r840819212
##########
File path: dev/atc.dev.sh
##########
@@ -162,6 +162,7 @@ function tm-health-client {
return $?;
}
+export API_VERSION=4.0
Review comment:
#6588 no longer uses `API_VERSION`, since it no longer defines a `to-req` function as of 57513153c0. IMO a `TO_API_VERSION` environment variable should still be defined somewhere so we don't hard-code the API version in URLs anywhere, but since this PR has no use for it, removed `API_VERSION` in c80f64501e.
--
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
[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1054652851
Rebased to remove cb4b4247c8, as it is already covered by #6591
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r840814892
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
Review comment:
Reusing `to-access.sh` from CDN in a Box in 5751315
--
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
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1086367198
> #6588 is rebased onto #6699 for now
Rebased onto master again now that #6699 is merged
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r816248533
##########
File path: dev/atc.dev.sh
##########
@@ -162,6 +162,7 @@ function tm-health-client {
return $?;
}
+export API_VERSION=4.0
Review comment:
Made `API_VERSION` unmodifiable in 741a09fba1
--
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
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1054639327
Drafting because it doesn't start up and takes awhile to build
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r816251976
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
Review comment:
Fourth https://github.com/apache/trafficcontrol/blob/741a09fba1b793b2c0c8a8771d55cd3d2e85dd0e/traffic_ops/install/bin/copy-pgdata.sh#L75
--
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
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r816272787
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
Review comment:
:facepalm:
--
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
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r816229221
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
+
+# Log in
+login_body="$(<<<{} jq --arg TO_USER "$TO_USER" --arg TO_PASSWORD "$TO_PASSWORD" '.u = $TO_USER | .p = $TO_PASSWORD')"
+to-req /user/login --data "$login_body"
+
+declare -A service_by_hostname
+service_by_hostname[trafficrouter]=trafficrouter
+service_by_hostname[edge]=t3c
+
+for hostname in trafficrouter edge; do
+ container_id="$(docker-compose ps -q "${service_by_hostname[$hostname]}")"
+ interface="$(<<'JSON' jq
+ {
+ "mtu": 1500,
+ "monitor": true,
+ "ipAddresses": [],
+ "name": "eth0"
+ }
+JSON
+ )"
+ for ip_address_field in IPv4Address IPv6Address; do
+ ip_address="$(docker network inspect dev.ciab.test |
+ jq -r --arg TR_CONTAINER_ID "$container_id" --arg IP_ADDRESS_FIELD "$ip_address_field" '.[0].Containers[$TR_CONTAINER_ID][$IP_ADDRESS_FIELD]')"
+ interface="$(<<<"$interface" jq --arg IP_ADDRESS "$ip_address" '.ipAddresses += [{} | .address = $IP_ADDRESS | .serviceAddress = true]')"
+ done
+
+
+ # Get Traffic Router server JSON
+ server="$(to-req "/servers?hostName=${hostname}" | jq '.response[0]')"
+ if [[ -z "$server" ]]; then
+ echo "Could not get JSON for server ${hostname}"
+ exit 1
+ fi
+
+ # Update Traffic Router's interface with its IP addresses
+ server="$(<<<"$server" jq ".interfaces = [${interface}]")"
+ server_id="$(<<<"$server" jq .id)"
+ if ! to-req "/servers/${server_id}" --request PUT --data "$server"; then
+ echo "Could not update server ${hostname} with ${server}"
+ fi
+done
+
+# Snapshot
+cdn_id="$(<<<"$server" jq .cdnId)"
+to-req "/snapshot?cdnID=${cdn_id}" --request PUT
+
+http_result=0 dns_result=0
+# Compile the tests
+go test -c ./traffic_router/ultimate-test-harness
+if ! ./ultimate-test-harness.test -test.v -test.run=^TestHTTPLoad$ -http_requests_threshold=5000; then
+ http_result=1
+fi
+
+if ! ./ultimate-test-harness.test -test.v -test.run=^TestDNSLoad$ -dns_requests_threshold=20500; then
+ dns_result=1
+fi
+if [[ $http_result -eq 0 && $dns_result -eq 0 ]]; then echo
+ echo Tests passed!
+else
+ echo Tests failed!
Review comment:
The script should exit with a non-zero code on failure
##########
File path: .github/actions/tr-ultimate-test-harness/tr-ultimate-test-harness.sh
##########
@@ -0,0 +1,104 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR;
+set -o xtrace
+set -o errexit -o nounset -o pipefail
+docker-compose pull
+docker-compose build --parallel
+docker-compose up -d
+
+# Constants
+declare -r cookie_name=dev-ciab-cookie
+
+# Set TO_USER, TO_PASSWORD, and TO_URL environment variables and get atc-ready function
+source dev/atc.dev.sh
+
+until atc-ready; do
+ echo 'Waiting until Traffic Ops is ready to accept requests...'
+ sleep 3
+done
+echo 'Traffic Ops is ready to accept requests!'
+
+to-req() {
+ endpoint="$1"
+ shift
+ local curl_command=(curl --insecure --silent --cookie-jar "$cookie_name" --cookie "$cookie_name" "${TO_URL}/api/${API_VERSION}")
+ "${curl_command[@]}${endpoint}" "$@" | jq
+}
Review comment:
If you use [the scripts provided by `toaccess`](https://traffic-control-cdn.readthedocs.io/en/latest/tools/toaccess.html#id1) (or the similar [`to_access.sh` script](https://github.com/apache/trafficcontrol/blob/f24c0b8257c8762e774c0154618294863a066a1a/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh) for less dependencies) you won't need to implement this yourself. This will be the third time (of which I'm aware) that some function like this is written in our repo.
##########
File path: dev/atc.dev.sh
##########
@@ -162,6 +162,7 @@ function tm-health-client {
return $?;
}
+export API_VERSION=4.0
Review comment:
Why bother making this modifiable if the only thing it affects is an endpoint that doesn't change with API version?
--
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
[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r840786942
##########
File path: dev/atc.dev.sh
##########
@@ -162,6 +162,7 @@ function tm-health-client {
return $?;
}
+export API_VERSION=4.0
Review comment:
I sort of meant why bother making it a variable at all. Just because it's undocumented that this value is exported to the execution environment, and somebody could possibly already be using it for something else.
--
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
[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#discussion_r838935011
##########
File path: dev/atc.dev.sh
##########
@@ -162,6 +162,7 @@ function tm-health-client {
return $?;
}
+export API_VERSION=4.0
Review comment:
Reverted 741a09fba1 in 93d477c1ca because if it is unmodifiable, sourcing `dev/atc.dev.sh` twice makes it print an error:
```bash
-bash: declare: API_VERSION: readonly variable
```
--
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
[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1083420011
#6588 is rebased onto #6699 for now
Edit: Removed #6699 workflow in fab34c4a3c so that #6588 does not build it
--
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
[GitHub] [trafficcontrol] zrhoffman commented on pull request #6588: TR Ultimate Test Harness GHA workflow
Posted by GitBox <gi...@apache.org>.
zrhoffman commented on pull request #6588:
URL: https://github.com/apache/trafficcontrol/pull/6588#issuecomment-1083420011
#6588 is rebased onto #6699 for now
--
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