-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
//go:build integration | ||
|
||
/* | ||
* @license | ||
* Copyright 2024 Dynatrace LLC | ||
* Licensed 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. | ||
*/ | ||
|
||
package v2 | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/dynatrace/dynatrace-configuration-as-code/v2/cmd/monaco/integrationtest/utils/monaco" | ||
"github.com/dynatrace/dynatrace-configuration-as-code/v2/internal/featureflags" | ||
"github.com/spf13/afero" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestDryRun(t *testing.T) { | ||
specificEnvironment := "platform_env" | ||
configFolder := "test-resources/integration-all-configs/" | ||
manifest := configFolder + "manifest.yaml" | ||
|
||
envVars := map[string]string{ | ||
featureflags.Temporary[featureflags.OpenPipeline].EnvName(): "true", | ||
featureflags.Temporary[featureflags.Documents].EnvName(): "true", | ||
} | ||
|
||
RunIntegrationWithCleanupGivenEnvs(t, configFolder, manifest, specificEnvironment, "AllConfigs", envVars, func(fs afero.Fs, _ TestContext) { | ||
// This causes a POST for all configs: | ||
err := monaco.RunWithFsf(fs, "monaco deploy %s --environment=%s --verbose --dry-run", manifest, specificEnvironment) | ||
assert.NoError(t, err) | ||
|
||
// This causes a PUT for all configs: | ||
err = monaco.RunWithFsf(fs, "monaco deploy %s --environment=%s --verbose --dry-run", manifest, specificEnvironment) | ||
assert.NoError(t, err) | ||
}) | ||
} |
7 changes: 7 additions & 0 deletions
7
...egration-all-configs/project/document-dashboard/a913d0e0-0349-4f00-8849-076305e31808.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"importedWithCode": false, | ||
"layouts": {}, | ||
"tiles": {}, | ||
"variables": [], | ||
"version": 14 | ||
} |
14 changes: 14 additions & 0 deletions
14
...tiontest/v2/test-resources/integration-all-configs/project/document-dashboard/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
configs: | ||
- id: a913d0e0-0349-4f00-8849-076305e31808 | ||
config: | ||
name: my-dashboard | ||
template: a913d0e0-0349-4f00-8849-076305e31808.json | ||
skip: false | ||
type: | ||
document: | ||
kind: dashboard | ||
private: true | ||
environmentOverrides: | ||
- environment: classic_env | ||
override: | ||
skip: true |
8 changes: 8 additions & 0 deletions
8
...tegration-all-configs/project/document-notebook/cb6f0c1b-90f0-4819-b822-ae1f2b10df40.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"defaultTimeframe": { | ||
"from": "now-2h", | ||
"to": "now" | ||
}, | ||
"sections": [], | ||
"version": "5" | ||
} |
14 changes: 14 additions & 0 deletions
14
...ationtest/v2/test-resources/integration-all-configs/project/document-notebook/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
configs: | ||
- id: cb6f0c1b-90f0-4819-b822-ae1f2b10df40 | ||
config: | ||
name: my-notebook | ||
template: cb6f0c1b-90f0-4819-b822-ae1f2b10df40.json | ||
skip: false | ||
type: | ||
document: | ||
kind: notebook | ||
private: false | ||
environmentOverrides: | ||
- environment: classic_env | ||
override: | ||
skip: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters