diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index 1ba0e3b999..6ce1cf83f3 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -451,7 +451,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest-m] - name: [corerp-cloud, ucp-cloud, datastoresrp-cloud] + name: [corerp-cloud, ucp-cloud] runs-on: ${{ matrix.os }} env: UNIQUE_ID: ${{ needs.build.outputs.UNIQUE_ID }} diff --git a/pkg/datastoresrp/processors/sqldatabases/processor_test.go b/pkg/datastoresrp/processors/sqldatabases/processor_test.go index 0337ee4ec7..a085ddae1f 100644 --- a/pkg/datastoresrp/processors/sqldatabases/processor_test.go +++ b/pkg/datastoresrp/processors/sqldatabases/processor_test.go @@ -20,7 +20,7 @@ import ( func Test_Process(t *testing.T) { processor := Processor{} - const azureSqlResourceID = "/subscriptions/85716382-7362-45c3-ae03-2126e459a123/resourceGroups/RadiusFunctionalTest/providers/Microsoft.Sql/servers/mssql-radiustest/databases/database-radiustest" + const azureSqlResourceID = "/subscriptions/0000/resourceGroups/test-group/providers/Microsoft.Sql/servers/sql.server/databases/database-radiustest" const server = "sql.server" const database = "database-radiustest" const port = 1433 diff --git a/test/createAzureTestResources.bicep b/test/createAzureTestResources.bicep index 1fac4a7775..2bb507fa2f 100644 --- a/test/createAzureTestResources.bicep +++ b/test/createAzureTestResources.bicep @@ -1,11 +1,5 @@ param location string = resourceGroup().location -@description('Specifies the SQL username.') -param adminUsername string - -@secure() -param adminPassword string - resource account 'Microsoft.DocumentDB/databaseAccounts@2020-04-01' = { name: 'account-radiustest' location: location @@ -28,30 +22,4 @@ resource account 'Microsoft.DocumentDB/databaseAccounts@2020-04-01' = { } } -resource server 'Microsoft.Sql/servers@2021-02-01-preview' = { - name: 'mssql-radiustest' - location: location - tags: { - radiustest: 'corerp-resources-microsoft-sql' - } - properties: { - administratorLogin: adminUsername - administratorLoginPassword: adminPassword - } - - resource db 'databases' = { - name: 'database-radiustest' - location: location - } - - resource firewall 'firewallRules' = { - name: 'allow' - properties: { - startIpAddress: '0.0.0.0' - endIpAddress: '0.0.0.0' - } - } -} - -output sqlServerId string = server::db.id output cosmosMongoAccountID string = account.id diff --git a/test/executeFunctionalTest.sh b/test/executeFunctionalTest.sh index 5ad27ec5c8..e2e1a5880a 100755 --- a/test/executeFunctionalTest.sh +++ b/test/executeFunctionalTest.sh @@ -26,14 +26,10 @@ fi resourcegroup=$1 echo $resourcegroup -# set the username and password for msqlDB to be passed as parameters to the bicep template -adminUser='coolUser' -adminPassword=$(uuidgen) -resp=$(az deployment group create --resource-group $resourcegroup --template-file createAzureTestResources.bicep --parameters 'adminUsername=$adminUser' --parameters 'adminPassword=$adminPassword') + +resp=$(az deployment group create --resource-group $resourcegroup --template-file createAzureTestResources.bicep) cat resp -export AZURE_MSSQL_RESOURCE_ID=$(jq -r '.properties.outputs.sqlServerId.value' <<<"${resp}") -export AZURE_MSSQL_USERNAME=$adminUser -export AZURE_MSSQL_PASSWORD=$adminPassword + export AZURE_COSMOS_MONGODB_ACCOUNT_ID=$(jq -r '.properties.outputs.cosmosMongoAccountID.value' <<<"${resp}") make test-functional-corerp make test-functional-msgrp diff --git a/test/functional-portable/datastoresrp/cloud/resources/microsoftsql_test.go b/test/functional-portable/datastoresrp/cloud/resources/microsoftsql_test.go index 57ad918316..b97c373989 100644 --- a/test/functional-portable/datastoresrp/cloud/resources/microsoftsql_test.go +++ b/test/functional-portable/datastoresrp/cloud/resources/microsoftsql_test.go @@ -16,66 +16,4 @@ limitations under the License. package resource_test -import ( - "os" - "testing" - - "github.com/radius-project/radius/test/rp" - "github.com/radius-project/radius/test/step" - "github.com/radius-project/radius/test/testutil" - "github.com/radius-project/radius/test/validation" -) - -func Test_MicrosoftSQL_Manual(t *testing.T) { - template := "testdata/datastoresrp-resources-microsoft-sql.bicep" - name := "dsrp-resources-microsoft-sql" - - var adminUsername, adminPassword string - - if os.Getenv("AZURE_MSSQL_RESOURCE_ID") == "" { - t.Error("AZURE_MSSQL_RESOURCE_ID environment variable must be set to run this test.") - } - if os.Getenv("AZURE_MSSQL_DATABASE") == "" || os.Getenv("AZURE_MSSQL_SERVER") == "" { - t.Error("AZURE_MSSQL_DATABASE and AZURE_MSSQL_SERVER environment variable must be set to run this test.") - } - if os.Getenv("AZURE_MSSQL_USERNAME") != "" && os.Getenv("AZURE_MSSQL_PASSWORD") != "" { - adminUsername = "adminUsername=" + os.Getenv("AZURE_MSSQL_USERNAME") - adminPassword = "adminPassword=" + os.Getenv("AZURE_MSSQL_PASSWORD") - } else { - t.Error("AZURE_MSSQL_USERNAME and AZURE_MSSQL_PASSWORD environment variable must be set to run this test.") - } - - mssqlresourceid := "mssqlresourceid=" + os.Getenv("AZURE_MSSQL_RESOURCE_ID") - sqlDatabse := "database=" + os.Getenv("AZURE_MSSQL_DATABASE") - sqlServer := "server=" + os.Getenv("AZURE_MSSQL_SERVER") - appNamespace := "default-dsrp-resources-microsoft-sql" - - test := rp.NewRPTest(t, name, []rp.TestStep{ - { - Executor: step.NewDeployExecutor(template, testutil.GetMagpieImage(), mssqlresourceid, adminUsername, adminPassword, sqlDatabse, sqlServer), - RPResources: &validation.RPResourceSet{ - Resources: []validation.RPResource{ - { - Name: name, - Type: validation.ApplicationsResource, - }, - { - Name: "mssql-app-ctnr", - Type: validation.ContainersResource, - App: name, - }, - }, - }, - K8sObjects: &validation.K8sObjectSet{ - Namespaces: map[string][]validation.K8sObject{ - appNamespace: { - validation.NewK8sPodForResource(name, "mssql-app-ctnr"), - }, - }, - }, - }, - }) - - test.RequiredFeatures = []rp.RequiredFeature{rp.FeatureAzure} - test.Test(t) -} +// TODO: This test will be deleted in a followup PR diff --git a/test/functional-portable/datastoresrp/cloud/resources/testdata/datastoresrp-resources-microsoft-sql.bicep b/test/functional-portable/datastoresrp/cloud/resources/testdata/datastoresrp-resources-microsoft-sql.bicep deleted file mode 100644 index 7cc28e8233..0000000000 --- a/test/functional-portable/datastoresrp/cloud/resources/testdata/datastoresrp-resources-microsoft-sql.bicep +++ /dev/null @@ -1,82 +0,0 @@ -extension radius - -@description('Specifies the location for resources.') -param location string = 'East US' - -@description('Specifies the image for the container resource.') -param magpieImage string - -@description('Specifies the port for the container resource.') -param magpiePort int = 3000 - -@description('Specifies the environment for resources.') -param environment string = 'test' - -@description('Specifies the SQL username.') -param adminUsername string - -@description('Specifies the SQL password.') -@secure() -param adminPassword string - -param mssqlresourceid string - -param database string - -param server string - -resource app 'Applications.Core/applications@2023-10-01-preview' = { - name: 'dsrp-resources-microsoft-sql' - location: location - properties: { - environment: environment - } -} - -resource sqlapp 'Applications.Core/containers@2023-10-01-preview' = { - name: 'mssql-app-ctnr' - location: location - properties: { - application: app.id - connections: { - sql: { - source: db.id - } - } - container: { - image: magpieImage - env: { - CONNECTION_SQL_CONNECTIONSTRING: { - value: db.listSecrets().connectionString - } - } - readinessProbe: { - kind: 'httpGet' - containerPort: magpiePort - path: '/healthz' - } - } - } -} - -resource db 'Applications.Datastores/sqlDatabases@2023-10-01-preview' = { - name: 'mssql-db' - location: location - properties: { - application: app.id - environment: environment - resourceProvisioning: 'manual' - resources: [ - { - id: mssqlresourceid - } - ] - database: database - server: server - port: 1433 - username: adminUsername - secrets: { - password: adminPassword - } - } -}