You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Why make this change?
- All code changes for **Multiple Create** feature was being merged into
`dev/NestedMutations` branch.
- This PR attempts to merge all these changes to the `main` branch in
preparation for the `0.12.* rc1` release
## What is this change?
- Right now, `dev/NestedMutations` branch contains the code changes for
the following components of Multiple Create feature
- Schema Generation -
#1902
- AuthZ - #1943
- Feature flag - CLI changes
#1983
- Feature flag - Re-naming changes
#2103
- Feature flag - Engine changes
#2116
- Each specified PR was reviewed before merging into
`dev/NestedMutations` branch.
- This PR aims to merge all the changes into `main` branch
## How was this tested?
- [x] Unit, Integration and Manual tests were performed on each PR
before merging into `dev/NestedMutations`
---------
Co-authored-by: Shyam Sundar J <[email protected]>
Co-authored-by: Sean Leonard <[email protected]>
/// Test to validate the usage of --graphql.multiple-create.enabled option of the init command for all database types.
136
+
///
137
+
/// 1. Behavior for database types other than MsSQL:
138
+
/// - Irrespective of whether the --graphql.multiple-create.enabled option is used or not, fields related to multiple-create will NOT be written to the config file.
139
+
/// - As a result, after deserialization of such a config file, the Runtime.GraphQL.MultipleMutationOptions is expected to be null.
140
+
/// 2. Behavior for MsSQL database type:
141
+
///
142
+
/// a. When --graphql.multiple-create.enabled option is used
143
+
/// - In this case, the fields related to multiple mutation and multiple create operations will be written to the config file.
144
+
/// "multiple-mutations": {
145
+
/// "create": {
146
+
/// "enabled": true/false
147
+
/// }
148
+
/// }
149
+
/// After deserializing such a config file, the Runtime.GraphQL.MultipleMutationOptions is expected to be non-null and the value of the "enabled" field is expected to be the same as the value passed in the init command.
150
+
///
151
+
/// b. When --graphql.multiple-create.enabled option is not used
152
+
/// - In this case, fields related to multiple mutation and multiple create operations will NOT be written to the config file.
153
+
/// - As a result, after deserialization of such a config file, the Runtime.GraphQL.MultipleMutationOptions is expected to be null.
154
+
///
155
+
/// </summary>
156
+
/// <param name="isMultipleCreateEnabled">Value interpreted by the CLI for '--graphql.multiple-create.enabled' option of the init command.
157
+
/// When not used, CLI interprets the value for the option as CliBool.None
158
+
/// When used with true/false, CLI interprets the value as CliBool.True/CliBool.False respectively.
159
+
/// </param>
160
+
/// <param name="expectedValueForMultipleCreateEnabledFlag"> Expected value for the multiple create enabled flag in the config file.</param>
161
+
[DataTestMethod]
162
+
[DataRow(CliBool.True,"mssql",DatabaseType.MSSQL,DisplayName="Init command with '--graphql.multiple-create.enabled true' for MsSql database type")]
163
+
[DataRow(CliBool.False,"mssql",DatabaseType.MSSQL,DisplayName="Init command with '--graphql.multiple-create.enabled false' for MsSql database type")]
164
+
[DataRow(CliBool.None,"mssql",DatabaseType.MSSQL,DisplayName="Init command without '--graphql.multiple-create.enabled' option for MsSql database type")]
165
+
[DataRow(CliBool.True,"mysql",DatabaseType.MySQL,DisplayName="Init command with '--graphql.multiple-create.enabled true' for MySql database type")]
166
+
[DataRow(CliBool.False,"mysql",DatabaseType.MySQL,DisplayName="Init command with '--graphql.multiple-create.enabled false' for MySql database type")]
167
+
[DataRow(CliBool.None,"mysql",DatabaseType.MySQL,DisplayName="Init command without '--graphql.multiple-create.enabled' option for MySql database type")]
168
+
[DataRow(CliBool.True,"postgresql",DatabaseType.PostgreSQL,DisplayName="Init command with '--graphql.multiple-create.enabled true' for PostgreSql database type")]
169
+
[DataRow(CliBool.False,"postgresql",DatabaseType.PostgreSQL,DisplayName="Init command with '--graphql.multiple-create.enabled false' for PostgreSql database type")]
170
+
[DataRow(CliBool.None,"postgresql",DatabaseType.PostgreSQL,DisplayName="Init command without '--graphql.multiple-create.enabled' option for PostgreSql database type")]
171
+
[DataRow(CliBool.True,"dwsql",DatabaseType.DWSQL,DisplayName="Init command with '--graphql.multiple-create.enabled true' for dwsql database type")]
172
+
[DataRow(CliBool.False,"dwsql",DatabaseType.DWSQL,DisplayName="Init command with '--graphql.multiple-create.enabled false' for dwsql database type")]
173
+
[DataRow(CliBool.None,"dwsql",DatabaseType.DWSQL,DisplayName="Init command without '--graphql.multiple-create.enabled' option for dwsql database type")]
174
+
[DataRow(CliBool.True,"cosmosdb_nosql",DatabaseType.CosmosDB_NoSQL,DisplayName="Init command with '--graphql.multiple-create.enabled true' for cosmosdb_nosql database type")]
175
+
[DataRow(CliBool.False,"cosmosdb_nosql",DatabaseType.CosmosDB_NoSQL,DisplayName="Init command with '--graphql.multiple-create.enabled false' for cosmosdb_nosql database type")]
176
+
[DataRow(CliBool.None,"cosmosdb_nosql",DatabaseType.CosmosDB_NoSQL,DisplayName="Init command without '--graphql.multiple-create.enabled' option for cosmosdb_nosql database type")]
Assert.IsNull(runtimeConfig.Runtime.GraphQL.MultipleMutationOptions,message:"MultipleMutationOptions is expected to be null because a) DB type is not MsSQL or b) Either --graphql.multiple-create.enabled option was not used or no value was provided.");
Copy file name to clipboardExpand all lines: src/Cli.Tests/InitTests.cs
+83Lines changed: 83 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -409,6 +409,89 @@ public Task GraphQLPathWithoutStartingSlashWillHaveItAdded()
409
409
returnExecuteVerifyTest(options);
410
410
}
411
411
412
+
/// <summary>
413
+
/// Test to validate the contents of the config file generated when init command is used with --graphql.multiple-create.enabled flag option for different database types.
414
+
///
415
+
/// 1. For database types other than MsSQL:
416
+
/// - Irrespective of whether the --graphql.multiple-create.enabled option is used or not, fields related to multiple-create will NOT be written to the config file.
417
+
///
418
+
/// 2. For MsSQL database type:
419
+
/// a. When --graphql.multiple-create.enabled option is used
420
+
/// - In this case, the fields related to multiple mutation and multiple create operations will be written to the config file.
421
+
/// "multiple-mutations": {
422
+
/// "create": {
423
+
/// "enabled": true/false
424
+
/// }
425
+
/// }
426
+
///
427
+
/// b. When --graphql.multiple-create.enabled option is not used
428
+
/// - In this case, fields related to multiple mutation and multiple create operations will NOT be written to the config file.
429
+
///
430
+
/// </summary>
431
+
[DataTestMethod]
432
+
[DataRow(DatabaseType.MSSQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for MsSQL database type")]
433
+
[DataRow(DatabaseType.MSSQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for MsSQL database type")]
434
+
[DataRow(DatabaseType.MSSQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for MsSQL database type")]
435
+
[DataRow(DatabaseType.PostgreSQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for PostgreSQL database type")]
436
+
[DataRow(DatabaseType.PostgreSQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for PostgreSQL database type")]
437
+
[DataRow(DatabaseType.PostgreSQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for PostgreSQL database type")]
438
+
[DataRow(DatabaseType.MySQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for MySQL database type")]
439
+
[DataRow(DatabaseType.MySQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for MySQL database type")]
440
+
[DataRow(DatabaseType.MySQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for MySQL database type")]
441
+
[DataRow(DatabaseType.CosmosDB_NoSQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for CosmosDB_NoSQL database type")]
442
+
[DataRow(DatabaseType.CosmosDB_NoSQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for CosmosDB_NoSQL database type")]
443
+
[DataRow(DatabaseType.CosmosDB_NoSQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for CosmosDB_NoSQL database type")]
444
+
[DataRow(DatabaseType.CosmosDB_PostgreSQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for CosmosDB_PostgreSQL database type")]
445
+
[DataRow(DatabaseType.CosmosDB_PostgreSQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for CosmosDB_PostgreSQL database type")]
446
+
[DataRow(DatabaseType.CosmosDB_PostgreSQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for CosmosDB_PostgreSQL database type")]
447
+
[DataRow(DatabaseType.DWSQL,CliBool.True,DisplayName="Init command with '--graphql.multiple-create.enabled true' for DWSQL database type")]
448
+
[DataRow(DatabaseType.DWSQL,CliBool.False,DisplayName="Init command with '--graphql.multiple-create.enabled false' for DWSQL database type")]
449
+
[DataRow(DatabaseType.DWSQL,CliBool.None,DisplayName="Init command without '--graphql.multiple-create.enabled' option for DWSQL database type")]
0 commit comments