File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,15 +51,22 @@ func TestProvider_impl(t *testing.T) {
5151}
5252
5353func testAccPreCheck (t * testing.T ) {
54- v1 := os .Getenv ("AZURE_PUBLISH_SETTINGS" )
55- v2 := os .Getenv ("AZURE_SETTINGS_FILE" )
54+ sf := os .Getenv ("PUBLISH_SETTINGS_FILE" )
55+ if sf != "" {
56+ publishSettings , err := ioutil .ReadFile (sf )
57+ if err != nil {
58+ t .Fatalf ("Error reading AZURE_SETTINGS_FILE path: %s" , err )
59+ }
60+
61+ os .Setenv ("AZURE_PUBLISH_SETTINGS" , string (publishSettings ))
62+ }
5663
57- if v1 == "" && v2 == "" {
64+ if v := os . Getenv ( "AZURE_PUBLISH_SETTINGS" ); v == "" {
5865 subscriptionID := os .Getenv ("AZURE_SUBSCRIPTION_ID" )
5966 certificate := os .Getenv ("AZURE_CERTIFICATE" )
6067
6168 if subscriptionID == "" || certificate == "" {
62- t .Fatal ("either AZURE_PUBLISH_SETTINGS, AZURE_SETTINGS_FILE , or AZURE_SUBSCRIPTION_ID " +
69+ t .Fatal ("either AZURE_PUBLISH_SETTINGS, PUBLISH_SETTINGS_FILE , or AZURE_SUBSCRIPTION_ID " +
6370 "and AZURE_CERTIFICATE must be set for acceptance tests" )
6471 }
6572 }
You can’t perform that action at this time.
0 commit comments