Skip to content

Commit 573117a

Browse files
[Cherrypick] Support environment variable serialization for data source options #1980 (#2016)
// only diff is excluded changes from mutationtests.cs for Cosmos that only exists in .11+. via #1893 ## Why make this change? - Closes #1956 - env variable replacement not happening in the `options` section of `data-source` property in our config. ## What is this change? - Added a DataSourceConverterFactory which will properly deserialize the data-source section considering the _replaceEnvVariable to decide weather to transform or not. ## How was this tested? - [X] Unit Tests --------- Co-authored-by: Abhishek Kumar <[email protected]>
1 parent c93c757 commit 573117a

File tree

26 files changed

+431
-94
lines changed

26 files changed

+431
-94
lines changed

src/Cli.Tests/Snapshots/EndToEndTests.TestAddingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceAsStoredProcedure.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithSourceWithDefaultType.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestConfigGeneratedAfterAddingEntityWithoutIEnumerables.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestInitForCosmosDBNoSql.verified.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
{
22
DataSource: {
33
Options: {
4-
container: {
5-
ValueKind: String
6-
},
7-
database: {
8-
ValueKind: String
9-
},
10-
schema: {
11-
ValueKind: String
12-
}
4+
container: planet,
5+
database: graphqldb,
6+
schema: test-schema.gql
137
}
148
},
159
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethods.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/EndToEndTests.TestUpdatingStoredProcedureWithRestMethodsAndGraphQLOperations.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: True
7-
}
5+
set-session-context: true
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/InitTests.CosmosDbNoSqlDatabase.verified.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
{
22
DataSource: {
33
Options: {
4-
container: {
5-
ValueKind: String
6-
},
7-
database: {
8-
ValueKind: String
9-
},
10-
schema: {
11-
ValueKind: String
12-
}
4+
container: testcontainer,
5+
database: testdb,
6+
schema: test-schema.gql
137
}
148
},
159
Runtime: {

src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_171ea8114ff71814.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: False
7-
}
5+
set-session-context: false
86
}
97
},
108
Runtime: {

src/Cli.Tests/Snapshots/InitTests.EnsureCorrectConfigGenerationWithDifferentAuthenticationProviders_2df7a1794712f154.verified.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
DataSource: {
33
DatabaseType: MSSQL,
44
Options: {
5-
set-session-context: {
6-
ValueKind: False
7-
}
5+
set-session-context: false
86
}
97
},
108
Runtime: {

0 commit comments

Comments
 (0)