You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by jh...@apache.org on 2020/08/14 04:10:55 UTC

[trafficcontrol] branch master updated: Perl-less tests (#4957)

This is an automated email from the ASF dual-hosted git repository.

jhg03a pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new bf2f05d  Perl-less tests (#4957)
bf2f05d is described below

commit bf2f05df25f08ceb1034a64eafbd8e8eb31f0246
Author: ocket8888 <oc...@apache.org>
AuthorDate: Thu Aug 13 22:10:44 2020 -0600

    Perl-less tests (#4957)
    
    * Remove dependency on Perl for TO API tests
    
    * Removed dependency of TO API tests on ISO generation support
---
 traffic_ops/testing/api/conf/traffic-ops-test.conf      | 4 +++-
 traffic_ops/testing/api/config/config.go                | 4 ++++
 traffic_ops/testing/api/v1/iso_test.go                  | 3 +++
 traffic_ops/testing/api/v1/userdeliveryservices_test.go | 3 +++
 traffic_ops/testing/api/v2/iso_test.go                  | 3 +++
 traffic_ops/testing/api/v3/iso_test.go                  | 3 +++
 6 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/traffic_ops/testing/api/conf/traffic-ops-test.conf b/traffic_ops/testing/api/conf/traffic-ops-test.conf
index 2d38297..38dfbbe 100644
--- a/traffic_ops/testing/api/conf/traffic-ops-test.conf
+++ b/traffic_ops/testing/api/conf/traffic-ops-test.conf
@@ -34,5 +34,7 @@
         "port": "5432",
         "type": "Pg",
         "user": "traffic_ops"
-    }
+    },
+    "noPerl": false,
+    "noISO": false
 }
diff --git a/traffic_ops/testing/api/config/config.go b/traffic_ops/testing/api/config/config.go
index d136614..94fd796 100644
--- a/traffic_ops/testing/api/config/config.go
+++ b/traffic_ops/testing/api/config/config.go
@@ -38,6 +38,10 @@ type Config struct {
 	TrafficOpsDB TrafficOpsDB `json:"trafficOpsDB"`
 	Default      Default      `json:"default"`
 	UseIMS       bool         `json:"use_ims"`
+	// Sets whether or not to perform tests that must proxy to Perl
+	NoPerl bool `json:"noPerl"`
+	// Sets whether or not to perform tests that involve ISO generation
+	NoISO bool `json:"noISO"`
 }
 
 // TrafficOps - config section
diff --git a/traffic_ops/testing/api/v1/iso_test.go b/traffic_ops/testing/api/v1/iso_test.go
index 0a7fca9..5ec91ab 100644
--- a/traffic_ops/testing/api/v1/iso_test.go
+++ b/traffic_ops/testing/api/v1/iso_test.go
@@ -26,6 +26,9 @@ import (
 )
 
 func TestGetOSVersions(t *testing.T) {
+	if Config.NoISO {
+		t.Skip("No ISO generation available")
+	}
 	// Default value per ./traffic_ops/install/data/json/osversions.json file.
 	// This should be the data returned in the CiaB environment.
 	expected := map[string]string{
diff --git a/traffic_ops/testing/api/v1/userdeliveryservices_test.go b/traffic_ops/testing/api/v1/userdeliveryservices_test.go
index fb826bc..d78a512 100644
--- a/traffic_ops/testing/api/v1/userdeliveryservices_test.go
+++ b/traffic_ops/testing/api/v1/userdeliveryservices_test.go
@@ -20,6 +20,9 @@ import (
 )
 
 func TestUserDeliveryServices(t *testing.T) {
+	if Config.NoPerl {
+		t.Skip("No Perl instance for proxying")
+	}
 	WithObjs(t, []TCObj{CDNs, Types, Tenants, Parameters, Profiles, Statuses, Divisions, Regions, PhysLocations, CacheGroups, DeliveryServices, UsersDeliveryServices}, func() {
 		GetTestUsersDeliveryServices(t)
 	})
diff --git a/traffic_ops/testing/api/v2/iso_test.go b/traffic_ops/testing/api/v2/iso_test.go
index b614bdb..805eb19 100644
--- a/traffic_ops/testing/api/v2/iso_test.go
+++ b/traffic_ops/testing/api/v2/iso_test.go
@@ -26,6 +26,9 @@ import (
 )
 
 func TestGetOSVersions(t *testing.T) {
+	if Config.NoISO {
+		t.Skip("No ISO generation available")
+	}
 	// Default value per ./traffic_ops/install/data/json/osversions.json file.
 	// This should be the data returned in the CiaB environment.
 	expected := map[string]string{
diff --git a/traffic_ops/testing/api/v3/iso_test.go b/traffic_ops/testing/api/v3/iso_test.go
index d450b1b..79e265e 100644
--- a/traffic_ops/testing/api/v3/iso_test.go
+++ b/traffic_ops/testing/api/v3/iso_test.go
@@ -26,6 +26,9 @@ import (
 )
 
 func TestGetOSVersions(t *testing.T) {
+	if Config.NoISO {
+		t.Skip("No ISO generation available")
+	}
 	// Default value per ./traffic_ops/install/data/json/osversions.json file.
 	// This should be the data returned in the CiaB environment.
 	expected := map[string]string{