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/05/11 11:43:11 UTC

[GitHub] [trafficcontrol] dmohan001c opened a new pull request #5832: Add TO Client API for Profile Parameters Automation

dmohan001c opened a new pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832


   ## What does this PR (Pull Request) do?
   
   - [x] This PR is not related to any Issue
   
   ## Which Traffic Control components are affected by this PR?
   
   - CDN in a Box
   - Traffic Control Client <!-- Please specify which; e.g. 'Python', 'Go', 'Java' -->
   - Traffic Ops
   - CI tests
   
   ## What is the best way to verify this PR?
   Execute all the Integration tests and make sure the tests passed.
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [ ] This PR includes tests OR I have explained why tests are unnecessary
   - [ ] This PR includes documentation OR I have explained why documentation is unnecessary
   - [ ] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [ ] This PR includes any and all required license headers
   - [ ] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   


-- 
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.

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



[GitHub] [trafficcontrol] dmohan001c commented on pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
dmohan001c commented on pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#issuecomment-846556653


   not sure, why the tests are failing here. tests are running without any failure in local.


-- 
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.

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#issuecomment-846989082


   There was a timing issue that was recently fixed, you may need to rebase.


-- 
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.

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



[GitHub] [trafficcontrol] dmohan001c commented on a change in pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
dmohan001c commented on a change in pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#discussion_r637540077



##########
File path: traffic_ops/testing/api/v4/profile_parameters_test.go
##########
@@ -144,35 +190,274 @@ func GetTestProfileParameters(t *testing.T) {
 
 func DeleteTestProfileParameters(t *testing.T) {
 
-	for _, pp := range testData.ProfileParameters {
-		DeleteTestProfileParameter(t, pp)
+	if len(testData.Profiles) > 0 && len(testData.Parameters) > 0 {
+		firstProfile := testData.Profiles[0]
+		opts := client.NewRequestOptions()
+		opts.QueryParameters.Set("name", firstProfile.Name)
+		profileResp, _, err := TOSession.GetProfiles(opts)
+		if err != nil {
+			t.Errorf("cannot GET Profile by name: %v - %v", firstProfile.Name, err)
+		}
+		if len(profileResp.Response) > 0 {
+			profileID := profileResp.Response[0].ID
+
+			firstParameter := testData.Parameters[0]
+			opts.QueryParameters.Set("name", firstParameter.Name)
+			paramResp, _, err := TOSession.GetParameters(opts)
+			if err != nil {
+				t.Errorf("cannot GET Parameter by name: %v - %v", firstParameter.Name, err)
+			}
+			if len(paramResp.Response) > 0 {
+				parameterID := paramResp.Response[0].ID
+				DeleteTestProfileParameter(t, profileID, parameterID)
+			} else {
+				t.Errorf("Parameter response is empty")
+			}
+		} else {
+			t.Errorf("Profile response is empty")
+		}
+	} else {
+		t.Errorf("Profiles and parameters are not available to delete")
 	}
 }
 
-func DeleteTestProfileParameter(t *testing.T, pp tc.ProfileParameter) {
+func DeleteTestProfileParameter(t *testing.T, profileId int, parameterId int) {
 	opts := client.NewRequestOptions()
-	opts.QueryParameters.Set("profileId", strconv.Itoa(pp.ProfileID))
-	opts.QueryParameters.Set("parameterId", strconv.Itoa(pp.ParameterID))
+	opts.QueryParameters.Set("profileId", strconv.Itoa(profileId))
+	opts.QueryParameters.Set("parameterId", strconv.Itoa(parameterId))
 	// Retrieve the PtofileParameter by profile so we can get the id for the Update
 	resp, _, err := TOSession.GetProfileParameters(opts)
 	if err != nil {
-		t.Errorf("cannot get Profile #%d/Parameter #%d association: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, resp.Alerts)
+		t.Errorf("cannot get Profile #%d/Parameter #%d association: %v - alerts: %+v", profileId, parameterId, err, resp.Alerts)
 	}
 	if len(resp.Response) > 0 {
-		respPP := resp.Response[0]
 
-		delResp, _, err := TOSession.DeleteProfileParameter(pp.ProfileID, respPP.Parameter, client.RequestOptions{})
+		delResp, _, err := TOSession.DeleteProfileParameter(profileId, parameterId, client.RequestOptions{})
 		if err != nil {
-			t.Errorf("cannot delete Profile #%d/Parameter #%d association: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, delResp.Alerts)
+			t.Errorf("cannot delete Profile #%d/Parameter #%d association: %v - alerts: %+v", profileId, parameterId, err, delResp.Alerts)
 		}
 
 		// Retrieve the Parameter to see if it got deleted
 		pps, _, err := TOSession.GetProfileParameters(opts)
 		if err != nil {
-			t.Errorf("error getting #%d/Parameter #%d association after deletion: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, pps.Alerts)
+			t.Errorf("error getting #%d/Parameter #%d association after deletion: %v - alerts: %+v", profileId, parameterId, err, pps.Alerts)
 		}
 		if len(pps.Response) > 0 {
-			t.Errorf("expected #%d/Parameter #%d association to be deleted, but it was found in Traffic Ops", pp.ProfileID, pp.ParameterID)
+			t.Errorf("expected #%d/Parameter #%d association to be deleted, but it was found in Traffic Ops", profileId, parameterId)
 		}
 	}
 }
+
+func CreateMultipleProfileParameters(t *testing.T) {
+
+	if len(testData.Parameters) < 2 || len(testData.Profiles) < 2 {
+		t.Fatal("Need at least two Profile and two Parameter to test associating a Parameter with a Profile")
+	}
+
+	firstProfile1 := testData.Profiles[0]
+	opts := client.NewRequestOptions()
+	opts.QueryParameters.Set("name", firstProfile1.Name)
+	profileResp1, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile1.Name, err)
+	}
+	if len(profileResp1.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile1.Name, len(profileResp1.Response))
+	}
+
+	firstProfile2 := testData.Profiles[1]
+	opts.QueryParameters.Set("name", firstProfile2.Name)
+	profileResp2, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile2.Name, err)
+	}
+	if len(profileResp2.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile2.Name, len(profileResp2.Response))
+	}
+
+	firstParameter1 := testData.Parameters[0]
+	opts.QueryParameters.Set("name", firstParameter1.Name)
+	paramResp1, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter1.Name, err, paramResp1.Alerts)
+	}
+	if len(paramResp1.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter1.Name, len(paramResp1.Response))
+	}
+
+	firstParameter2 := testData.Parameters[1]
+	opts.QueryParameters.Set("name", firstParameter2.Name)
+	paramResp2, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter2.Name, err, paramResp2.Alerts)
+	}
+	if len(paramResp2.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter2.Name, len(paramResp2.Response))
+	}
+
+	profileID1 := profileResp1.Response[0].ID
+	parameterID1 := paramResp1.Response[0].ID
+	profileID2 := profileResp2.Response[0].ID
+	parameterID2 := paramResp2.Response[0].ID
+
+	DeleteTestProfileParameter(t, profileID1, parameterID1)
+	DeleteTestProfileParameter(t, profileID2, parameterID2)
+
+	pp := tc.ProfileParameterCreationRequest{
+		ProfileID:   profileID1,
+		ParameterID: parameterID1,
+	}
+	pp2 := tc.ProfileParameterCreationRequest{
+		ProfileID:   profileID2,
+		ParameterID: parameterID2,
+	}
+
+	ppSlice := []tc.ProfileParameterCreationRequest{
+		pp,
+		pp2,
+	}
+	_, _, err = TOSession.CreateMultipleProfileParameters(ppSlice, client.RequestOptions{})
+	if err != nil {
+		t.Errorf("could not CREATE profile parameters: %v", err)
+	}
+}
+
+func CreateProfileWithMultipleParameters(t *testing.T) {
+	if len(testData.Parameters) < 2 || len(testData.Profiles) < 2 {
+		t.Fatal("Need at least two Profile and two Parameter to test associating a Parameter with a Profile")
+	}
+	firstProfile1 := testData.Profiles[0]
+	opts := client.NewRequestOptions()
+	opts.QueryParameters.Set("name", firstProfile1.Name)
+	profileResp1, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile1.Name, err)
+	}
+	if len(profileResp1.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile1.Name, len(profileResp1.Response))
+	}
+
+	firstProfile2 := testData.Profiles[1]
+	opts.QueryParameters.Set("name", firstProfile2.Name)
+	profileResp2, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile2.Name, err)
+	}
+	if len(profileResp2.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile2.Name, len(profileResp2.Response))
+	}
+
+	firstParameter1 := testData.Parameters[0]
+	opts.QueryParameters.Set("name", firstParameter1.Name)
+	paramResp1, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter1.Name, err, paramResp1.Alerts)
+	}
+	if len(paramResp1.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter1.Name, len(paramResp1.Response))
+	}
+
+	firstParameter2 := testData.Parameters[1]
+	opts.QueryParameters.Set("name", firstParameter2.Name)
+	paramResp2, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter2.Name, err, paramResp2.Alerts)
+	}
+	if len(paramResp2.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter2.Name, len(paramResp2.Response))
+	}
+
+	profileID1 := profileResp1.Response[0].ID
+	parameterID1 := paramResp1.Response[0].ID
+	profileID2 := profileResp2.Response[0].ID

Review comment:
       Removed that line.




-- 
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.

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



[GitHub] [trafficcontrol] dmohan001c commented on a change in pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
dmohan001c commented on a change in pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#discussion_r637540026



##########
File path: traffic_ops/traffic_ops_golang/profileparameter/parameterprofilebyname.go
##########
@@ -22,9 +22,10 @@ package profileparameter
 import (
 	"database/sql"
 	"errors"
-	"github.com/apache/trafficcontrol/lib/go-util"
 	"net/http"
 
+	"github.com/apache/trafficcontrol/lib/go-util"
+

Review comment:
       Removed.




-- 
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.

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#discussion_r636995654



##########
File path: traffic_ops/traffic_ops_golang/profileparameter/parameterprofilebyname.go
##########
@@ -22,9 +22,10 @@ package profileparameter
 import (
 	"database/sql"
 	"errors"
-	"github.com/apache/trafficcontrol/lib/go-util"
 	"net/http"
 
+	"github.com/apache/trafficcontrol/lib/go-util"
+

Review comment:
       Can you remove this blank line?

##########
File path: traffic_ops/testing/api/v4/profile_parameters_test.go
##########
@@ -144,35 +190,274 @@ func GetTestProfileParameters(t *testing.T) {
 
 func DeleteTestProfileParameters(t *testing.T) {
 
-	for _, pp := range testData.ProfileParameters {
-		DeleteTestProfileParameter(t, pp)
+	if len(testData.Profiles) > 0 && len(testData.Parameters) > 0 {
+		firstProfile := testData.Profiles[0]
+		opts := client.NewRequestOptions()
+		opts.QueryParameters.Set("name", firstProfile.Name)
+		profileResp, _, err := TOSession.GetProfiles(opts)
+		if err != nil {
+			t.Errorf("cannot GET Profile by name: %v - %v", firstProfile.Name, err)
+		}
+		if len(profileResp.Response) > 0 {
+			profileID := profileResp.Response[0].ID
+
+			firstParameter := testData.Parameters[0]
+			opts.QueryParameters.Set("name", firstParameter.Name)
+			paramResp, _, err := TOSession.GetParameters(opts)
+			if err != nil {
+				t.Errorf("cannot GET Parameter by name: %v - %v", firstParameter.Name, err)
+			}
+			if len(paramResp.Response) > 0 {
+				parameterID := paramResp.Response[0].ID
+				DeleteTestProfileParameter(t, profileID, parameterID)
+			} else {
+				t.Errorf("Parameter response is empty")
+			}
+		} else {
+			t.Errorf("Profile response is empty")
+		}
+	} else {
+		t.Errorf("Profiles and parameters are not available to delete")
 	}
 }
 
-func DeleteTestProfileParameter(t *testing.T, pp tc.ProfileParameter) {
+func DeleteTestProfileParameter(t *testing.T, profileId int, parameterId int) {
 	opts := client.NewRequestOptions()
-	opts.QueryParameters.Set("profileId", strconv.Itoa(pp.ProfileID))
-	opts.QueryParameters.Set("parameterId", strconv.Itoa(pp.ParameterID))
+	opts.QueryParameters.Set("profileId", strconv.Itoa(profileId))
+	opts.QueryParameters.Set("parameterId", strconv.Itoa(parameterId))
 	// Retrieve the PtofileParameter by profile so we can get the id for the Update
 	resp, _, err := TOSession.GetProfileParameters(opts)
 	if err != nil {
-		t.Errorf("cannot get Profile #%d/Parameter #%d association: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, resp.Alerts)
+		t.Errorf("cannot get Profile #%d/Parameter #%d association: %v - alerts: %+v", profileId, parameterId, err, resp.Alerts)
 	}
 	if len(resp.Response) > 0 {
-		respPP := resp.Response[0]
 
-		delResp, _, err := TOSession.DeleteProfileParameter(pp.ProfileID, respPP.Parameter, client.RequestOptions{})
+		delResp, _, err := TOSession.DeleteProfileParameter(profileId, parameterId, client.RequestOptions{})
 		if err != nil {
-			t.Errorf("cannot delete Profile #%d/Parameter #%d association: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, delResp.Alerts)
+			t.Errorf("cannot delete Profile #%d/Parameter #%d association: %v - alerts: %+v", profileId, parameterId, err, delResp.Alerts)
 		}
 
 		// Retrieve the Parameter to see if it got deleted
 		pps, _, err := TOSession.GetProfileParameters(opts)
 		if err != nil {
-			t.Errorf("error getting #%d/Parameter #%d association after deletion: %v - alerts: %+v", pp.ProfileID, pp.ParameterID, err, pps.Alerts)
+			t.Errorf("error getting #%d/Parameter #%d association after deletion: %v - alerts: %+v", profileId, parameterId, err, pps.Alerts)
 		}
 		if len(pps.Response) > 0 {
-			t.Errorf("expected #%d/Parameter #%d association to be deleted, but it was found in Traffic Ops", pp.ProfileID, pp.ParameterID)
+			t.Errorf("expected #%d/Parameter #%d association to be deleted, but it was found in Traffic Ops", profileId, parameterId)
 		}
 	}
 }
+
+func CreateMultipleProfileParameters(t *testing.T) {
+
+	if len(testData.Parameters) < 2 || len(testData.Profiles) < 2 {
+		t.Fatal("Need at least two Profile and two Parameter to test associating a Parameter with a Profile")
+	}
+
+	firstProfile1 := testData.Profiles[0]
+	opts := client.NewRequestOptions()
+	opts.QueryParameters.Set("name", firstProfile1.Name)
+	profileResp1, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile1.Name, err)
+	}
+	if len(profileResp1.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile1.Name, len(profileResp1.Response))
+	}
+
+	firstProfile2 := testData.Profiles[1]
+	opts.QueryParameters.Set("name", firstProfile2.Name)
+	profileResp2, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile2.Name, err)
+	}
+	if len(profileResp2.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile2.Name, len(profileResp2.Response))
+	}
+
+	firstParameter1 := testData.Parameters[0]
+	opts.QueryParameters.Set("name", firstParameter1.Name)
+	paramResp1, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter1.Name, err, paramResp1.Alerts)
+	}
+	if len(paramResp1.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter1.Name, len(paramResp1.Response))
+	}
+
+	firstParameter2 := testData.Parameters[1]
+	opts.QueryParameters.Set("name", firstParameter2.Name)
+	paramResp2, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter2.Name, err, paramResp2.Alerts)
+	}
+	if len(paramResp2.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter2.Name, len(paramResp2.Response))
+	}
+
+	profileID1 := profileResp1.Response[0].ID
+	parameterID1 := paramResp1.Response[0].ID
+	profileID2 := profileResp2.Response[0].ID
+	parameterID2 := paramResp2.Response[0].ID
+
+	DeleteTestProfileParameter(t, profileID1, parameterID1)
+	DeleteTestProfileParameter(t, profileID2, parameterID2)
+
+	pp := tc.ProfileParameterCreationRequest{
+		ProfileID:   profileID1,
+		ParameterID: parameterID1,
+	}
+	pp2 := tc.ProfileParameterCreationRequest{
+		ProfileID:   profileID2,
+		ParameterID: parameterID2,
+	}
+
+	ppSlice := []tc.ProfileParameterCreationRequest{
+		pp,
+		pp2,
+	}
+	_, _, err = TOSession.CreateMultipleProfileParameters(ppSlice, client.RequestOptions{})
+	if err != nil {
+		t.Errorf("could not CREATE profile parameters: %v", err)
+	}
+}
+
+func CreateProfileWithMultipleParameters(t *testing.T) {
+	if len(testData.Parameters) < 2 || len(testData.Profiles) < 2 {
+		t.Fatal("Need at least two Profile and two Parameter to test associating a Parameter with a Profile")
+	}
+	firstProfile1 := testData.Profiles[0]
+	opts := client.NewRequestOptions()
+	opts.QueryParameters.Set("name", firstProfile1.Name)
+	profileResp1, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile1.Name, err)
+	}
+	if len(profileResp1.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile1.Name, len(profileResp1.Response))
+	}
+
+	firstProfile2 := testData.Profiles[1]
+	opts.QueryParameters.Set("name", firstProfile2.Name)
+	profileResp2, _, err := TOSession.GetProfiles(opts)
+	if err != nil {
+		t.Errorf("cannot GET Profile by name: %v - %v", firstProfile2.Name, err)
+	}
+	if len(profileResp2.Response) != 1 {
+		t.Fatalf("Expected exactly one Profile to exist with name '%s', found: %d", firstProfile2.Name, len(profileResp2.Response))
+	}
+
+	firstParameter1 := testData.Parameters[0]
+	opts.QueryParameters.Set("name", firstParameter1.Name)
+	paramResp1, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter1.Name, err, paramResp1.Alerts)
+	}
+	if len(paramResp1.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter1.Name, len(paramResp1.Response))
+	}
+
+	firstParameter2 := testData.Parameters[1]
+	opts.QueryParameters.Set("name", firstParameter2.Name)
+	paramResp2, _, err := TOSession.GetParameters(opts)
+	if err != nil {
+		t.Errorf("cannot get Parameter by name '%s': %v - alerts: %+v", firstParameter2.Name, err, paramResp2.Alerts)
+	}
+	if len(paramResp2.Response) < 1 {
+		t.Fatalf("Expected at least one Parameter to exist with name '%s', found: %d", firstParameter2.Name, len(paramResp2.Response))
+	}
+
+	profileID1 := profileResp1.Response[0].ID
+	parameterID1 := paramResp1.Response[0].ID
+	profileID2 := profileResp2.Response[0].ID

Review comment:
       If the first Profile is the only one you're actually using for the test of assigning multiple Parameters to a Profile, why even bother fetching a second Profile?




-- 
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.

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



[GitHub] [trafficcontrol] ocket8888 merged pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
ocket8888 merged pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832


   


-- 
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.

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



[GitHub] [trafficcontrol] ocket8888 merged pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
ocket8888 merged pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832


   


-- 
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.

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



[GitHub] [trafficcontrol] dmohan001c commented on pull request #5832: Add TO Client API for Profile Parameters Automation

Posted by GitBox <gi...@apache.org>.
dmohan001c commented on pull request #5832:
URL: https://github.com/apache/trafficcontrol/pull/5832#issuecomment-847510359


   > There was a timing issue that was recently fixed, you may need to rebase.
   
   Fixed.


-- 
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.

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