diff --git a/codebuild_specs/e2e_workflow.yml b/codebuild_specs/e2e_workflow.yml index a755cb1fba..30105d5069 100644 --- a/codebuild_specs/e2e_workflow.yml +++ b/codebuild_specs/e2e_workflow.yml @@ -60,88 +60,87 @@ batch: compute-type: BUILD_GENERAL1_MEDIUM depend-on: - build_linux - - identifier: auth_2_datastore_modelgen_mock_api_amplify_app + - identifier: auth_2_datastore_modelgen_amplify_app_custom_transformers buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/auth_2.test.ts|src/__tests__/datastore-modelgen.test.ts|src/__tests__/mock-api.test.ts|src/__tests__/amplify-app.test.ts + src/__tests__/auth_2.test.ts|src/__tests__/datastore-modelgen.test.ts|src/__tests__/amplify-app.test.ts|src/__tests__/graphql-v2/custom-transformers.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: >- - custom_transformers_schema_versioned_invalid_input_arguments_schema_data_access_patterns + mock_api_invalid_input_arguments_schema_versioned_schema_data_access_patterns buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/graphql-v2/custom-transformers.test.ts|src/__tests__/schema-versioned.test.ts|src/__tests__/graphql-v2/invalid-input-arguments.test.ts|src/__tests__/schema-data-access-patterns.test.ts + src/__tests__/mock-api.test.ts|src/__tests__/graphql-v2/invalid-input-arguments.test.ts|src/__tests__/schema-versioned.test.ts|src/__tests__/schema-data-access-patterns.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: predictions_migration_schema_predictions_function_10_api_7 + - identifier: predictions_migration_function_10_schema_predictions_api_7 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/schema-predictions.test.ts|src/__tests__/function_10.test.ts|src/__tests__/api_7.test.ts + src/__tests__/transformer-migrations/predictions-migration.test.ts|src/__tests__/function_10.test.ts|src/__tests__/schema-predictions.test.ts|src/__tests__/api_7.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: http_migration_schema_function_2_global_sandbox_api_connection_migration + - identifier: http_migration_global_sandbox_schema_function_2_api_connection_migration buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/schema-function-2.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/migration/api.connection.migration.test.ts + src/__tests__/transformer-migrations/http-migration.test.ts|src/__tests__/global_sandbox.test.ts|src/__tests__/schema-function-2.test.ts|src/__tests__/migration/api.connection.migration.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: >- - schema_iterative_update_3_api_8_auth_migration_schema_iterative_update_locking + - identifier: api_8_schema_iterative_update_3_auth_migration_lambda_conflict_handler buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/api_8.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/schema-iterative-update-locking.test.ts - CLI_REGION: eu-west-2 + src/__tests__/api_8.test.ts|src/__tests__/schema-iterative-update-3.test.ts|src/__tests__/transformer-migrations/auth-migration.test.ts|src/__tests__/graphql-v2/lambda-conflict-handler.test.ts + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- - schema_iterative_update_1_lambda_conflict_handler_index_with_stack_mappings_schema_iterative_update_2 + schema_iterative_update_1_schema_iterative_update_locking_index_with_stack_mappings_api_4 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/graphql-v2/lambda-conflict-handler.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts|src/__tests__/schema-iterative-update-2.test.ts + src/__tests__/schema-iterative-update-1.test.ts|src/__tests__/schema-iterative-update-locking.test.ts|src/__tests__/graphql-v2/index-with-stack-mappings.test.ts|src/__tests__/api_4.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- - custom_policies_container_api_4_api_connection_migration2_containers_api_secrets + custom_policies_container_schema_iterative_update_2_api_connection_migration2_api_5 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/custom_policies_container.test.ts|src/__tests__/api_4.test.ts|src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/containers-api-secrets.test.ts - CLI_REGION: us-east-1 + src/__tests__/custom_policies_container.test.ts|src/__tests__/schema-iterative-update-2.test.ts|src/__tests__/migration/api.connection.migration2.test.ts|src/__tests__/api_5.test.ts + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: api_5_schema_function_1_api_3_generate_ts_data_schema + - identifier: containers_api_secrets_schema_function_1_api_3_generate_ts_data_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/api_5.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_3.test.ts|src/__tests__/generate_ts_data_schema.test.ts - CLI_REGION: ca-central-1 + src/__tests__/containers-api-secrets.test.ts|src/__tests__/schema-function-1.test.ts|src/__tests__/api_3.test.ts|src/__tests__/generate_ts_data_schema.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: resolvers_sync_query_datastore_api_6_api_lambda_auth @@ -151,7 +150,7 @@ batch: variables: TEST_SUITE: >- src/__tests__/resolvers.test.ts|src/__tests__/graphql-v2/sync_query_datastore.test.ts|src/__tests__/api_6.test.ts|src/__tests__/graphql-v2/api_lambda_auth.test.ts - CLI_REGION: ap-east-1 + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: api_9 @@ -163,21 +162,21 @@ batch: CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_v2 + - identifier: api_10 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-v2.test.ts + TEST_SUITE: src/__tests__/api_10.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: api_10 + - identifier: rds_v2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_10.test.ts + TEST_SUITE: src/__tests__/rds-v2.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry @@ -200,23 +199,23 @@ batch: USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: schema_iterative_update_5 + - identifier: api_key_migration5 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-iterative-update-5.test.ts + TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts CLI_REGION: eu-north-1 + USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: api_key_migration5 + - identifier: schema_iterative_update_5 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/migration/api.key.migration5.test.ts - CLI_REGION: eu-west-3 - USE_PARENT_ACCOUNT: 1 + TEST_SUITE: src/__tests__/schema-iterative-update-5.test.ts + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: model_migration @@ -225,24 +224,24 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/transformer-migrations/model-migration.test.ts - CLI_REGION: eu-west-1 + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_2 + - identifier: schema_auth_10 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-2.test.ts + TEST_SUITE: src/__tests__/schema-auth-10.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: schema_auth_10 + - identifier: schema_auth_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-10.test.ts + TEST_SUITE: src/__tests__/schema-auth-2.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry @@ -255,86 +254,86 @@ batch: CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_13 + - identifier: schema_auth_12 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-13.test.ts + TEST_SUITE: src/__tests__/schema-auth-12.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_12 + - identifier: schema_auth_13 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-12.test.ts + TEST_SUITE: src/__tests__/schema-auth-13.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_3 + - identifier: schema_auth_15 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-3.test.ts + TEST_SUITE: src/__tests__/schema-auth-15.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_15 + - identifier: schema_auth_3 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-15.test.ts + TEST_SUITE: src/__tests__/schema-auth-3.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: schema_iterative_rollback_1 + - identifier: api_key_migration4 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts + TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts CLI_REGION: ap-northeast-2 + USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: api_key_migration4 + - identifier: schema_iterative_rollback_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/migration/api.key.migration4.test.ts + TEST_SUITE: src/__tests__/schema-iterative-rollback-1.test.ts CLI_REGION: ap-south-1 - USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: schema_key + - identifier: schema_iterative_rollback_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-key.test.ts + TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: schema_iterative_rollback_2 + - identifier: schema_key buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-iterative-rollback-2.test.ts + TEST_SUITE: src/__tests__/schema-key.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_8 + - identifier: containers_api_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-8.test.ts - CLI_REGION: eu-central-1 + TEST_SUITE: src/__tests__/containers-api-1.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: schema_auth_4 @@ -346,32 +345,32 @@ batch: CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: containers_api_1 + - identifier: schema_auth_8 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/containers-api-1.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/schema-auth-8.test.ts + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_11 + - identifier: api_key_migration2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-11.test.ts + TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts CLI_REGION: eu-west-1 + USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: api_key_migration2 + - identifier: schema_auth_11 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/migration/api.key.migration2.test.ts + TEST_SUITE: src/__tests__/schema-auth-11.test.ts CLI_REGION: eu-west-2 - USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - identifier: api_key_migration1 @@ -383,291 +382,282 @@ batch: CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: sql_generate_unauth - buildspec: codebuild_specs/run_e2e_tests.yml - env: - compute-type: BUILD_GENERAL1_SMALL - variables: - TEST_SUITE: src/__tests__/sql-generate-unauth.test.ts - CLI_REGION: ap-northeast-2 - depend-on: - - publish_to_local_registry - - identifier: schema_model + - identifier: api_11 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-model.test.ts - CLI_REGION: sa-east-1 + TEST_SUITE: src/__tests__/api_11.test.ts + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: rds_v2_test_utils + - identifier: api_canary_ap_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: rds_relational_directives + - identifier: api_canary_ap_northeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-relational-directives.test.ts - CLI_REGION: us-east-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_v2_generate_schema + - identifier: api_canary_ap_northeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts - CLI_REGION: us-west-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_userpool_auth + - identifier: api_canary_ap_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts - CLI_REGION: us-west-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_userpool_auth_fields + - identifier: api_canary_ap_southeast_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-userpool-auth-fields.test.ts - CLI_REGION: eu-north-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_relational_directives + - identifier: api_canary_ap_southeast_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts - CLI_REGION: ap-northeast-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_refers_to + - identifier: api_canary_ca_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts - CLI_REGION: ap-northeast-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_refers_to_fields + - identifier: api_canary_eu_central_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts - CLI_REGION: ap-south-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_oidc_auth + - identifier: api_canary_eu_north_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts - CLI_REGION: ap-southeast-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_oidc_auth_fields + - identifier: api_canary_eu_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-oidc-auth-fields.test.ts - CLI_REGION: ap-southeast-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_model_v2 + - identifier: api_canary_eu_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts - CLI_REGION: ca-central-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_import + - identifier: api_canary_eu_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-import.test.ts - CLI_REGION: eu-central-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_userpool_static_dynamic + - identifier: api_canary_eu_west_3 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-userpool-static-dynamic.test.ts - CLI_REGION: eu-north-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_userpool_iam + - identifier: api_canary_me_south_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-userpool-iam.test.ts - CLI_REGION: ap-northeast-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_lambda + - identifier: api_canary_sa_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-lambda.test.ts - CLI_REGION: eu-west-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_identityPool + - identifier: api_canary_us_east_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-identityPool.test.ts - CLI_REGION: eu-west-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_iam + - identifier: api_canary_us_east_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-iam.test.ts - CLI_REGION: eu-west-3 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_field_auth_apikey + - identifier: api_canary_us_west_1 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-field-auth-apikey.test.ts - CLI_REGION: ap-southeast-2 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_custom_claims_refersto_auth + - identifier: api_canary_us_west_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts - CLI_REGION: sa-east-1 + TEST_SUITE: src/__tests__/api_canary.test.ts + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam + - identifier: rds_mysql_auth_apikey_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts + TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_iam_apikey_lambda_subscription + - identifier: rds_mysql_auth_iam_apikey_lambda_subscription buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts + TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_pg_auth_apikey_lambda + - identifier: rds_mysql_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts + TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_pg_array_objects + - identifier: rds_mysql_custom_claims_refersto_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts + TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_v2_generate_schema + - identifier: rds_mysql_field_auth_apikey buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-apikey.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_mysql_userpool_auth + - identifier: rds_mysql_field_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-iam.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_userpool_auth_fields + - identifier: rds_mysql_field_auth_identityPool buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-userpool-auth-fields.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-identityPool.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_refers_to + - identifier: rds_mysql_field_auth_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-lambda.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_refers_to_fields + - identifier: rds_mysql_field_auth_userpool_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-userpool-iam.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_oidc_auth + - identifier: rds_mysql_field_auth_userpool_static_dynamic buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts + TEST_SUITE: src/__tests__/rds-mysql-field-auth-userpool-static-dynamic.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_oidc_auth_fields + - identifier: rds_mysql_model_v2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-oidc-auth-fields.test.ts + TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry @@ -680,282 +670,291 @@ batch: CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_model_v2 + - identifier: rds_mysql_oidc_auth_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-model-v2.test.ts + TEST_SUITE: src/__tests__/rds-mysql-oidc-auth-fields.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_userpool_static_dynamic + - identifier: rds_mysql_oidc_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-userpool-static-dynamic.test.ts + TEST_SUITE: src/__tests__/rds-mysql-oidc-auth.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_userpool_iam + - identifier: rds_mysql_refers_to_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-userpool-iam.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to-fields.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_lambda + - identifier: rds_mysql_refers_to buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-lambda.test.ts + TEST_SUITE: src/__tests__/rds-mysql-refers-to.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_identityPool + - identifier: rds_mysql_userpool_auth_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-identityPool.test.ts + TEST_SUITE: src/__tests__/rds-mysql-userpool-auth-fields.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_iam + - identifier: rds_mysql_userpool_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-iam.test.ts + TEST_SUITE: src/__tests__/rds-mysql-userpool-auth.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_field_auth_apikey + - identifier: rds_mysql_v2_generate_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-field-auth-apikey.test.ts + TEST_SUITE: src/__tests__/rds-mysql-v2-generate-schema.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_custom_claims_refersto_auth + - identifier: rds_pg_array_objects buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-custom-claims-refersto-auth.test.ts + TEST_SUITE: src/__tests__/rds-pg-array-objects.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_auth_iam + - identifier: rds_pg_auth_apikey_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-iam.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-apikey-lambda.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: rds_mysql_auth_iam_apikey_lambda_subscription + - identifier: rds_pg_auth_iam_apikey_lambda_subscription buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-iam-apikey-lambda-subscription.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-iam-apikey-lambda-subscription.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: rds_mysql_auth_apikey_lambda + - identifier: rds_pg_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/rds-mysql-auth-apikey-lambda.test.ts + TEST_SUITE: src/__tests__/rds-pg-auth-iam.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_east_1 + - identifier: rds_pg_custom_claims_refersto_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: ap-east-1 + TEST_SUITE: src/__tests__/rds-pg-custom-claims-refersto-auth.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_northeast_1 + - identifier: rds_pg_field_auth_apikey buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-apikey.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_northeast_2 + - identifier: rds_pg_field_auth_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-iam.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_south_1 + - identifier: rds_pg_field_auth_identityPool buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-identityPool.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_southeast_1 + - identifier: rds_pg_field_auth_lambda buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-lambda.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: api_canary_ap_southeast_2 + - identifier: rds_pg_field_auth_userpool_iam buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-userpool-iam.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: api_canary_ca_central_1 + - identifier: rds_pg_field_auth_userpool_static_dynamic buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-field-auth-userpool-static-dynamic.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_central_1 + - identifier: rds_pg_import buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-import.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_north_1 + - identifier: rds_pg_model_v2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-model-v2.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_south_1 + - identifier: rds_pg_oidc_auth_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: eu-south-1 + TEST_SUITE: src/__tests__/rds-pg-oidc-auth-fields.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_west_1 + - identifier: rds_pg_oidc_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-oidc-auth.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_west_2 + - identifier: rds_pg_refers_to_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-refers-to-fields.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: api_canary_eu_west_3 + - identifier: rds_pg_refers_to buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-refers-to.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: api_canary_me_south_1 + - identifier: rds_pg_relational_directives buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts - CLI_REGION: me-south-1 + TEST_SUITE: src/__tests__/rds-pg-relational-directives.test.ts + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: api_canary_sa_east_1 + - identifier: rds_pg_userpool_auth_fields buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-userpool-auth-fields.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: api_canary_us_east_1 + - identifier: rds_pg_userpool_auth buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-userpool-auth.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: api_canary_us_east_2 + - identifier: rds_pg_v2_generate_schema buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-pg-v2-generate-schema.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: api_canary_us_west_1 + - identifier: rds_relational_directives buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-relational-directives.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: api_canary_us_west_2 + - identifier: rds_v2_test_utils buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_canary.test.ts + TEST_SUITE: src/__tests__/rds-v2-test-utils.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: api_11 + - identifier: schema_model buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/api_11.test.ts + TEST_SUITE: src/__tests__/schema-model.test.ts + CLI_REGION: ap-east-1 + depend-on: + - publish_to_local_registry + - identifier: sql_generate_unauth + buildspec: codebuild_specs/run_e2e_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-generate-unauth.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry @@ -968,40 +967,40 @@ batch: CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: schema_auth_9 + - identifier: containers_api_2 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-9.test.ts - CLI_REGION: ap-south-1 + TEST_SUITE: src/__tests__/containers-api-2.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_7 + - identifier: schema_auth_14 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-7.test.ts + TEST_SUITE: src/__tests__/schema-auth-14.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: schema_auth_14 + - identifier: schema_auth_7 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-14.test.ts + TEST_SUITE: src/__tests__/schema-auth-7.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: containers_api_2 + - identifier: schema_auth_9 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/containers-api-2.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/schema-auth-9.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - identifier: api_1 @@ -1022,13 +1021,13 @@ batch: CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: schema_searchable + - identifier: searchable_datastore buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-searchable.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts + CLI_REGION: eu-west-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry @@ -1041,31 +1040,31 @@ batch: CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: searchable_datastore + - identifier: schema_searchable buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/graphql-v2/searchable-datastore.test.ts - CLI_REGION: eu-west-2 + TEST_SUITE: src/__tests__/schema-searchable.test.ts + CLI_REGION: us-west-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: schema_connection + - identifier: schema_auth_6 buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-connection.test.ts + TEST_SUITE: src/__tests__/schema-auth-6.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: schema_auth_6 + - identifier: schema_connection buildspec: codebuild_specs/run_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/schema-auth-6.test.ts + TEST_SUITE: src/__tests__/schema-connection.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry @@ -1108,141 +1107,129 @@ batch: USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: utils_ddb_iam_access_data_construct_custom_logic + - identifier: add_resources_custom_logic_data_construct_ddb_iam_access buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/utils.test.ts|src/__tests__/ddb-iam-access.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/custom-logic.test.ts - CLI_REGION: eu-west-1 + src/__tests__/add-resources.test.ts|src/__tests__/custom-logic.test.ts|src/__tests__/data-construct.test.ts|src/__tests__/ddb-iam-access.test.ts + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: >- - add_resources_restricted_field_auth_gen2_restricted_field_auth_gen1_references + 3_gsis_10k_records_3_gsis_1k_records_3_gsis_empty_table_3_gsis_single_record buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/add-resources.test.ts|src/__tests__/restricted-field-auth/restricted-field-auth-gen2.test.ts|src/__tests__/restricted-field-auth/restricted-field-auth-gen1.test.ts|src/__tests__/relationships/references/references.test.ts + src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: >- - relationships_gen1_single_gsi_single_record_single_gsi_empty_table_single_gsi_1k_records - buildspec: codebuild_specs/run_cdk_tests.yml - env: - compute-type: BUILD_GENERAL1_MEDIUM - variables: - TEST_SUITE: >- - src/__tests__/relationships/gen1/relationships-gen1.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts - CLI_REGION: us-east-2 - depend-on: - - publish_to_local_registry - - identifier: >- - single_gsi_10k_records_replace_2_gsis_update_attr_single_record_replace_2_gsis_update_attr_empty_table_replace_2_gsis_update_at + replace_2_gsis_10k_records_replace_2_gsis_1k_records_replace_2_gsis_empty_table_replace_2_gsis_single_record buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts - CLI_REGION: eu-north-1 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_update_attr_10k_records_replace_2_gsis_single_record_replace_2_gsis_empty_table_replace_2_gsis_1k_records + replace_2_gsis_update_attr_10k_records_replace_2_gsis_update_attr_1k_records_replace_2_gsis_update_attr_empty_table_replace_2_g buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-1k-records.test.ts - CLI_REGION: eu-south-1 + src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-update-attr-single-record.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- - replace_2_gsis_10k_records_3_gsis_single_record_3_gsis_empty_table_3_gsis_1k_records + single_gsi_10k_records_single_gsi_1k_records_single_gsi_empty_table_single_gsi_single_record buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/replace-2-gsis-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-single-record.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-1k-records.test.ts - CLI_REGION: eu-west-1 + src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-10k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-1k-records.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-empty-table.test.ts|src/__tests__/deploy-velocity-temporarily-disabled/single-gsi-single-record.test.ts + CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: 3_gsis_10k_records + - identifier: utils buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: - TEST_SUITE: >- - src/__tests__/deploy-velocity-temporarily-disabled/3-gsis-10k-records.test.ts - CLI_REGION: eu-west-2 + TEST_SUITE: src/__tests__/utils.test.ts + CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: sql_pg_models + - identifier: admin_role buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-pg-models.test.ts + TEST_SUITE: src/__tests__/admin-role.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: sql_pg_canary + - identifier: all_auth_modes buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-pg-canary.test.ts + TEST_SUITE: src/__tests__/all-auth-modes.test.ts CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: sql_mysql_canary + - identifier: amplify_ddb_canary buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-mysql-canary.test.ts + TEST_SUITE: src/__tests__/amplify-ddb-canary.test.ts CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - - identifier: sql_models_2 + - identifier: amplify_table_1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-models-2.test.ts + TEST_SUITE: src/__tests__/amplify-table-1.test.ts CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - - identifier: sql_models_1 + - identifier: amplify_table_2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-models-1.test.ts + TEST_SUITE: src/__tests__/amplify-table-2.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: sql_iam_access + - identifier: amplify_table_3 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/sql-iam-access.test.ts + TEST_SUITE: src/__tests__/amplify-table-3.test.ts CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: default_ddb_canary + - identifier: amplify_table_4 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/default-ddb-canary.test.ts + TEST_SUITE: src/__tests__/amplify-table-4.test.ts CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry @@ -1417,95 +1404,110 @@ batch: CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: amplify_table_4 + - identifier: default_ddb_canary buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/amplify-table-4.test.ts + TEST_SUITE: src/__tests__/default-ddb-canary.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: amplify_table_3 + - identifier: 3_gsis_100k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/amplify-table-3.test.ts - CLI_REGION: eu-west-1 + TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts + CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: amplify_table_2 + - identifier: replace_2_gsis_100k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/amplify-table-2.test.ts - CLI_REGION: eu-west-2 + TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts + CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - - identifier: amplify_table_1 + - identifier: replace_2_gsis_update_attr_100k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/amplify-table-1.test.ts - CLI_REGION: eu-west-3 + TEST_SUITE: >- + src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts + CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - - identifier: amplify_ddb_canary + - identifier: single_gsi_100k_records buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/amplify-ddb-canary.test.ts - CLI_REGION: me-south-1 + TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts + CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - - identifier: all_auth_modes + - identifier: dynamic_group_auth_ddbprimary_ddbrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/all-auth-modes.test.ts - CLI_REGION: sa-east-1 + TEST_SUITE: >- + src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-ddbprimary-ddbrelated.test.ts + CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: admin_role + - identifier: dynamic_group_auth_ddbprimary_sqlrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/admin-role.test.ts - CLI_REGION: us-east-1 + TEST_SUITE: >- + src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-ddbprimary-sqlrelated.test.ts + CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - - identifier: bind_sql_ids + - identifier: dynamic_group_auth_sqlprimary_ddbrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/owner-auth/bind-sql-ids/bind-sql-ids.test.ts - CLI_REGION: us-west-1 + TEST_SUITE: >- + src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-sqlprimary-ddbrelated.test.ts + CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - - identifier: assoc_field + - identifier: dynamic_group_auth_sqlprimary_sqlrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/owner-auth/assoc-field/assoc-field.test.ts - CLI_REGION: us-west-2 + TEST_SUITE: >- + src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-sqlprimary-sqlrelated.test.ts + CLI_REGION: ap-northeast-2 depend-on: - publish_to_local_registry - - identifier: static_group_auth_sqlprimary_sqlrelated + - identifier: static_group_auth_ddbprimary_ddbrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: >- - src/__tests__/group-auth/static-group-auth/static-group-auth-sqlprimary-sqlrelated.test.ts - CLI_REGION: us-east-1 + src/__tests__/group-auth/static-group-auth/static-group-auth-ddbprimary-ddbrelated.test.ts + CLI_REGION: ap-south-1 + depend-on: + - publish_to_local_registry + - identifier: static_group_auth_ddbprimary_sqlrelated + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: >- + src/__tests__/group-auth/static-group-auth/static-group-auth-ddbprimary-sqlrelated.test.ts + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: static_group_auth_sqlprimary_ddbrelated @@ -1515,288 +1517,342 @@ batch: variables: TEST_SUITE: >- src/__tests__/group-auth/static-group-auth/static-group-auth-sqlprimary-ddbrelated.test.ts - CLI_REGION: ap-northeast-1 + CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - - identifier: static_group_auth_ddbprimary_sqlrelated + - identifier: static_group_auth_sqlprimary_sqlrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: >- - src/__tests__/group-auth/static-group-auth/static-group-auth-ddbprimary-sqlrelated.test.ts - CLI_REGION: ap-northeast-2 + src/__tests__/group-auth/static-group-auth/static-group-auth-sqlprimary-sqlrelated.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: static_group_auth_ddbprimary_ddbrelated + - identifier: assoc_field buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/group-auth/static-group-auth/static-group-auth-ddbprimary-ddbrelated.test.ts - CLI_REGION: ap-south-1 + TEST_SUITE: src/__tests__/owner-auth/assoc-field/assoc-field.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - - identifier: dynamic_group_auth_sqlprimary_sqlrelated + - identifier: bind_sql_ids buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-sqlprimary-sqlrelated.test.ts - CLI_REGION: ap-southeast-1 + TEST_SUITE: src/__tests__/owner-auth/bind-sql-ids/bind-sql-ids.test.ts + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - - identifier: dynamic_group_auth_sqlprimary_ddbrelated + - identifier: relationships_gen1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: >- - src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-sqlprimary-ddbrelated.test.ts - CLI_REGION: ap-southeast-2 + TEST_SUITE: src/__tests__/relationships/gen1/relationships-gen1.test.ts + CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - - identifier: dynamic_group_auth_ddbprimary_sqlrelated + - identifier: references_ddbprimary_ddbrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: >- - src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-ddbprimary-sqlrelated.test.ts - CLI_REGION: ca-central-1 + src/__tests__/relationships/references/references-ddbprimary-ddbrelated.test.ts + CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - - identifier: dynamic_group_auth_ddbprimary_ddbrelated + - identifier: references_ddbprimary_sqlrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: >- - src/__tests__/group-auth/dynamic-group-auth/dynamic-group-auth-ddbprimary-ddbrelated.test.ts - CLI_REGION: eu-central-1 + src/__tests__/relationships/references/references-ddbprimary-sqlrelated.test.ts + CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - - identifier: single_gsi_100k_records + - identifier: references_sqlprimary_ddbrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/deploy-velocity/single-gsi-100k-records.test.ts + TEST_SUITE: >- + src/__tests__/relationships/references/references-sqlprimary-ddbrelated.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - - identifier: replace_2_gsis_update_attr_100k_records + - identifier: references_sqlprimary_sqlrelated buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: >- - src/__tests__/deploy-velocity/replace-2-gsis-update-attr-100k-records.test.ts + src/__tests__/relationships/references/references-sqlprimary-sqlrelated.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - - identifier: replace_2_gsis_100k_records + - identifier: restricted_field_auth_gen1 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts + TEST_SUITE: >- + src/__tests__/restricted-field-auth/restricted-field-auth-gen1.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - - identifier: 3_gsis_100k_records + - identifier: restricted_field_auth_gen2 buildspec: codebuild_specs/run_cdk_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/deploy-velocity/3-gsis-100k-records.test.ts + TEST_SUITE: >- + src/__tests__/restricted-field-auth/restricted-field-auth-gen2.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry + - identifier: sql_iam_access + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-iam-access.test.ts + CLI_REGION: us-east-2 + depend-on: + - publish_to_local_registry + - identifier: sql_models_1 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-models-1.test.ts + CLI_REGION: us-west-1 + depend-on: + - publish_to_local_registry + - identifier: sql_models_2 + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-models-2.test.ts + CLI_REGION: us-west-2 + depend-on: + - publish_to_local_registry + - identifier: sql_mysql_canary + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-mysql-canary.test.ts + CLI_REGION: eu-west-3 + depend-on: + - publish_to_local_registry + - identifier: sql_pg_canary + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-pg-canary.test.ts + CLI_REGION: ap-northeast-1 + depend-on: + - publish_to_local_registry + - identifier: sql_pg_models + buildspec: codebuild_specs/run_cdk_tests.yml + env: + compute-type: BUILD_GENERAL1_SMALL + variables: + TEST_SUITE: src/__tests__/sql-pg-models.test.ts + CLI_REGION: ap-northeast-2 + depend-on: + - publish_to_local_registry - identifier: >- - TestComplexStackMappingsLocal_NestedStacksTest_KeyTransformerLocal_CustomRoots + CustomRoots_KeyTransformerLocal_NestedStacksTest_TestComplexStackMappingsLocal buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/TestComplexStackMappingsLocal.e2e.test.ts|src/__tests__/NestedStacksTest.e2e.test.ts|src/__tests__/KeyTransformerLocal.e2e.test.ts|src/__tests__/CustomRoots.e2e.test.ts + src/__tests__/CustomRoots.e2e.test.ts|src/__tests__/KeyTransformerLocal.e2e.test.ts|src/__tests__/NestedStacksTest.e2e.test.ts|src/__tests__/TestComplexStackMappingsLocal.e2e.test.ts CLI_REGION: ap-east-1 depend-on: - publish_to_local_registry - identifier: >- - NonModelAuthV2Function_VersionedModelTransformer_TransformerOptionsV2_PredictionsTransformerV2Tests + NonModelAuthV2Function_FunctionTransformerTests_KeyWithAuth_MutationCondition buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/NonModelAuthV2Function.e2e.test.ts|src/__tests__/VersionedModelTransformer.e2e.test.ts|src/__tests__/TransformerOptionsV2.e2e.test.ts|src/__tests__/PredictionsTransformerV2Tests.e2e.test.ts + src/__tests__/NonModelAuthV2Function.e2e.test.ts|src/__tests__/FunctionTransformerTests.e2e.test.ts|src/__tests__/KeyWithAuth.e2e.test.ts|src/__tests__/MutationCondition.e2e.test.ts CLI_REGION: ap-northeast-1 depend-on: - publish_to_local_registry - identifier: >- - PredictionsTransformerTests_PerFieldAuthTests_NoneEnvFunctionTransformer_NonModelAuthFunction + NoneEnvFunctionTransformer_NonModelAuthFunction_PerFieldAuthTests_PredictionsTransformerTests buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/PredictionsTransformerTests.e2e.test.ts|src/__tests__/PerFieldAuthTests.e2e.test.ts|src/__tests__/NoneEnvFunctionTransformer.e2e.test.ts|src/__tests__/NonModelAuthFunction.e2e.test.ts - CLI_REGION: ap-northeast-2 + src/__tests__/NoneEnvFunctionTransformer.e2e.test.ts|src/__tests__/NonModelAuthFunction.e2e.test.ts|src/__tests__/PerFieldAuthTests.e2e.test.ts|src/__tests__/PredictionsTransformerTests.e2e.test.ts + CLI_REGION: ap-south-1 depend-on: - publish_to_local_registry - identifier: >- - MutationCondition_KeyWithAuth_FunctionTransformerTests_DynamoDBModelTransformer + PredictionsTransformerV2Tests_TransformerOptionsV2_VersionedModelTransformer_ConnectionsWithAuthTests buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/MutationCondition.e2e.test.ts|src/__tests__/KeyWithAuth.e2e.test.ts|src/__tests__/FunctionTransformerTests.e2e.test.ts|src/__tests__/DynamoDBModelTransformer.e2e.test.ts - CLI_REGION: ap-south-1 + src/__tests__/PredictionsTransformerV2Tests.e2e.test.ts|src/__tests__/TransformerOptionsV2.e2e.test.ts|src/__tests__/VersionedModelTransformer.e2e.test.ts|src/__tests__/ConnectionsWithAuthTests.e2e.test.ts + CLI_REGION: ap-southeast-1 depend-on: - publish_to_local_registry - identifier: >- - DefaultValueTransformer_ConnectionsWithAuthTests_RelationalWithOwnerFieldAsKeySchemaAuth_NewConnectionWithAuth + DefaultValueTransformer_DynamoDBModelTransformer_ModelConnectionTransformer_NewConnectionTransformer buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/DefaultValueTransformer.e2e.test.ts|src/__tests__/ConnectionsWithAuthTests.e2e.test.ts|src/__tests__/RelationalWithOwnerFieldAsKeySchemaAuth.e2e.test.ts|src/__tests__/NewConnectionWithAuth.e2e.test.ts + src/__tests__/DefaultValueTransformer.e2e.test.ts|src/__tests__/DynamoDBModelTransformer.e2e.test.ts|src/__tests__/ModelConnectionTransformer.e2e.test.ts|src/__tests__/NewConnectionTransformer.e2e.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry - identifier: >- - NewConnectionTransformer_ModelConnectionTransformer_SubscriptionsWithAuthTest_PerFieldAuthV2TransformerWithFF + NewConnectionWithAuth_RelationalWithOwnerFieldAsKeySchemaAuth_BelongsToTransformerV2_KeyTransformer buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/NewConnectionTransformer.e2e.test.ts|src/__tests__/ModelConnectionTransformer.e2e.test.ts|src/__tests__/SubscriptionsWithAuthTest.e2e.test.ts|src/__tests__/PerFieldAuthV2TransformerWithFF.e2e.test.ts - CLI_REGION: ca-central-1 + src/__tests__/NewConnectionWithAuth.e2e.test.ts|src/__tests__/RelationalWithOwnerFieldAsKeySchemaAuth.e2e.test.ts|src/__tests__/BelongsToTransformerV2.e2e.test.ts|src/__tests__/KeyTransformer.e2e.test.ts + CLI_REGION: eu-north-1 depend-on: - publish_to_local_registry - identifier: >- - PerFieldAuthV2Transformer_ModelAuthTransformer_KeyTransformer_BelongsToTransformerV2 + ModelAuthTransformer_PerFieldAuthV2Transformer_PerFieldAuthV2TransformerWithFF_SubscriptionsWithAuthTest buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/PerFieldAuthV2Transformer.e2e.test.ts|src/__tests__/ModelAuthTransformer.e2e.test.ts|src/__tests__/KeyTransformer.e2e.test.ts|src/__tests__/BelongsToTransformerV2.e2e.test.ts + src/__tests__/ModelAuthTransformer.e2e.test.ts|src/__tests__/PerFieldAuthV2Transformer.e2e.test.ts|src/__tests__/PerFieldAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/SubscriptionsWithAuthTest.e2e.test.ts CLI_REGION: eu-south-1 depend-on: - publish_to_local_registry - identifier: >- - RelationalWithAuthV2WithFF_ModelConnectionWithKeyTransformer_IndexWithAuthV2_MultiAuthModelAuthTransformer + IndexWithAuthV2_ModelConnectionWithKeyTransformer_RelationalWithAuthV2WithFF_IndexWithAuthV2WithFF buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/RelationalWithAuthV2WithFF.e2e.test.ts|src/__tests__/ModelConnectionWithKeyTransformer.e2e.test.ts|src/__tests__/IndexWithAuthV2.e2e.test.ts|src/__tests__/MultiAuthModelAuthTransformer.e2e.test.ts + src/__tests__/IndexWithAuthV2.e2e.test.ts|src/__tests__/ModelConnectionWithKeyTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2WithFF.e2e.test.ts|src/__tests__/IndexWithAuthV2WithFF.e2e.test.ts CLI_REGION: eu-west-1 depend-on: - publish_to_local_registry - identifier: >- - IndexWithAuthV2WithFF_SubscriptionsWithAuthV2WithFF_MultiAuthV2Transformer_ModelTransformer + MultiAuthModelAuthTransformer_IndexWithClaimFieldAsSortKeyAuth_ModelTransformer_MultiAuthV2Transformer buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/IndexWithAuthV2WithFF.e2e.test.ts|src/__tests__/SubscriptionsWithAuthV2WithFF.e2e.test.ts|src/__tests__/MultiAuthV2Transformer.e2e.test.ts|src/__tests__/ModelTransformer.e2e.test.ts + src/__tests__/MultiAuthModelAuthTransformer.e2e.test.ts|src/__tests__/IndexWithClaimFieldAsSortKeyAuth.e2e.test.ts|src/__tests__/ModelTransformer.e2e.test.ts|src/__tests__/MultiAuthV2Transformer.e2e.test.ts CLI_REGION: eu-west-2 depend-on: - publish_to_local_registry - identifier: >- - IndexWithClaimFieldAsSortKeyAuth_SubscriptionsWithAuthV2_RelationalWithAuthV2_MapsToTransformer + SubscriptionsWithAuthV2WithFF_MapsToTransformer_RelationalWithAuthV2_SubscriptionsWithAuthV2 buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/IndexWithClaimFieldAsSortKeyAuth.e2e.test.ts|src/__tests__/SubscriptionsWithAuthV2.e2e.test.ts|src/__tests__/RelationalWithAuthV2.e2e.test.ts|src/__tests__/MapsToTransformer.e2e.test.ts + src/__tests__/SubscriptionsWithAuthV2WithFF.e2e.test.ts|src/__tests__/MapsToTransformer.e2e.test.ts|src/__tests__/RelationalWithAuthV2.e2e.test.ts|src/__tests__/SubscriptionsWithAuthV2.e2e.test.ts CLI_REGION: eu-west-3 depend-on: - publish_to_local_registry - identifier: >- - MultiAuthV2TransformerWithFF_IndexTransformer_AuthV2Transformer_AuthV2ExhaustiveT1B + IndexTransformer_MultiAuthV2TransformerWithFF_AuthV2Transformer_AuthV2ExhaustiveT1A buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/MultiAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/IndexTransformer.e2e.test.ts|src/__tests__/AuthV2Transformer.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1B.test.ts + src/__tests__/IndexTransformer.e2e.test.ts|src/__tests__/MultiAuthV2TransformerWithFF.e2e.test.ts|src/__tests__/AuthV2Transformer.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1A.test.ts CLI_REGION: me-south-1 depend-on: - publish_to_local_registry - identifier: >- - AuthV2ExhaustiveT1A_IndexWithAutoQueryField_AuthV2TransformerWithFF_SubscriptionsRuntimeFiltering + AuthV2ExhaustiveT1B_AuthV2TransformerWithFF_IndexWithAutoQueryField_AuthV2ExhaustiveT1C buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/AuthV2ExhaustiveT1A.test.ts|src/__tests__/IndexWithAutoQueryField.e2e.test.ts|src/__tests__/AuthV2TransformerWithFF.e2e.test.ts|src/__tests__/SubscriptionsRuntimeFiltering.e2e.test.ts + src/__tests__/AuthV2ExhaustiveT1B.test.ts|src/__tests__/AuthV2TransformerWithFF.e2e.test.ts|src/__tests__/IndexWithAutoQueryField.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1C.test.ts CLI_REGION: sa-east-1 depend-on: - publish_to_local_registry - identifier: >- - RelationalTransformers_AuthV2ExhaustiveT2A_AuthV2ExhaustiveT1C_AuthV2ExhaustiveT1D + AuthV2ExhaustiveT2A_RelationalTransformers_SubscriptionsRuntimeFiltering_AuthV2ExhaustiveT1D buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/RelationalTransformers.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT2A.test.ts|src/__tests__/AuthV2ExhaustiveT1C.test.ts|src/__tests__/AuthV2ExhaustiveT1D.test.ts + src/__tests__/AuthV2ExhaustiveT2A.test.ts|src/__tests__/RelationalTransformers.e2e.test.ts|src/__tests__/SubscriptionsRuntimeFiltering.e2e.test.ts|src/__tests__/AuthV2ExhaustiveT1D.test.ts CLI_REGION: us-east-1 depend-on: - publish_to_local_registry - identifier: >- - AuthV2ExhaustiveT2B_AuthV2ExhaustiveT2D_AuthV2ExhaustiveT2C_AuthV2TransformerIAM + AuthV2ExhaustiveT2B_AuthV2ExhaustiveT2D_AuthV2ExhaustiveT2C_AuthV2ExhaustiveT3A buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/AuthV2ExhaustiveT2B.test.ts|src/__tests__/AuthV2ExhaustiveT2D.test.ts|src/__tests__/AuthV2ExhaustiveT2C.test.ts|src/__tests__/AuthV2TransformerIAM.test.ts + src/__tests__/AuthV2ExhaustiveT2B.test.ts|src/__tests__/AuthV2ExhaustiveT2D.test.ts|src/__tests__/AuthV2ExhaustiveT2C.test.ts|src/__tests__/AuthV2ExhaustiveT3A.test.ts CLI_REGION: us-east-2 depend-on: - publish_to_local_registry - identifier: >- - AuthV2ExhaustiveT3D_AuthV2ExhaustiveT3C_AuthV2ExhaustiveT3B_AuthV2ExhaustiveT3A + AuthV2ExhaustiveT3B_AuthV2ExhaustiveT3C_AuthV2ExhaustiveT3D_AuthV2TransformerIAM buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/AuthV2ExhaustiveT3D.test.ts|src/__tests__/AuthV2ExhaustiveT3C.test.ts|src/__tests__/AuthV2ExhaustiveT3B.test.ts|src/__tests__/AuthV2ExhaustiveT3A.test.ts + src/__tests__/AuthV2ExhaustiveT3B.test.ts|src/__tests__/AuthV2ExhaustiveT3C.test.ts|src/__tests__/AuthV2ExhaustiveT3D.test.ts|src/__tests__/AuthV2TransformerIAM.test.ts CLI_REGION: us-west-1 depend-on: - publish_to_local_registry - identifier: >- - SearchableModelTransformerV2_SearchableWithAuthTests_SearchableModelTransformer_SearchableWithAuthV2WithFF + SearchableModelTransformerV2_SearchableWithAuthTests_SearchableModelTransformer_SearchableWithAuthV2 buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: TEST_SUITE: >- - src/__tests__/SearchableModelTransformerV2.e2e.test.ts|src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts + src/__tests__/SearchableModelTransformerV2.e2e.test.ts|src/__tests__/SearchableWithAuthTests.e2e.test.ts|src/__tests__/SearchableModelTransformer.e2e.test.ts|src/__tests__/SearchableWithAuthV2.e2e.test.ts CLI_REGION: us-west-2 depend-on: - publish_to_local_registry - - identifier: SearchableWithAuthV2 + - identifier: SearchableWithAuthV2WithFF buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_MEDIUM variables: - TEST_SUITE: src/__tests__/SearchableWithAuthV2.e2e.test.ts + TEST_SUITE: src/__tests__/SearchableWithAuthV2WithFF.e2e.test.ts CLI_REGION: ap-southeast-2 depend-on: - publish_to_local_registry @@ -1806,26 +1862,26 @@ batch: compute-type: BUILD_GENERAL1_SMALL variables: TEST_SUITE: src/__tests__/FunctionTransformerTestsV2.e2e.test.ts - CLI_REGION: ap-southeast-1 + CLI_REGION: ap-northeast-2 USE_PARENT_ACCOUNT: 1 depend-on: - publish_to_local_registry - - identifier: HttpTransformerV2 + - identifier: HttpTransformer buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/HttpTransformerV2.e2e.test.ts - CLI_REGION: eu-central-1 + TEST_SUITE: src/__tests__/HttpTransformer.e2e.test.ts + CLI_REGION: ca-central-1 depend-on: - publish_to_local_registry - - identifier: HttpTransformer + - identifier: HttpTransformerV2 buildspec: codebuild_specs/graphql_e2e_tests.yml env: compute-type: BUILD_GENERAL1_SMALL variables: - TEST_SUITE: src/__tests__/HttpTransformer.e2e.test.ts - CLI_REGION: eu-north-1 + TEST_SUITE: src/__tests__/HttpTransformerV2.e2e.test.ts + CLI_REGION: eu-central-1 depend-on: - publish_to_local_registry - identifier: cleanup_e2e_resources @@ -1833,4 +1889,4 @@ batch: env: compute-type: BUILD_GENERAL1_SMALL depend-on: - - auth_2_datastore_modelgen_mock_api_amplify_app + - auth_2_datastore_modelgen_amplify_app_custom_transformers diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-constants.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-constants.ts index c252965677..afa1b1b34a 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-constants.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-constants.ts @@ -7,6 +7,7 @@ export const DURATION_20_MINUTES = 20 * ONE_MINUTE; export const DURATION_30_MINUTES = 30 * ONE_MINUTE; export const DURATION_45_MINUTES = 45 * ONE_MINUTE; export const DURATION_1_HOUR = 60 * ONE_MINUTE; +export const DURATION_90_MINUTES = 90 * ONE_MINUTE; export const COUNT_1_THOUSAND = 1000; export const COUNT_10_THOUSAND = 10000; diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-test-core.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-test-core.ts index ba4bf4f768..c16f436425 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-test-core.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/deploy-velocity-test-core.ts @@ -5,9 +5,9 @@ import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e- import { AmplifyGraphqlApi } from '@aws-amplify/graphql-api-construct'; import { initCDKProject, cdkDeploy, cdkDestroy } from '../../commands'; import { ValidateGraphqlOptions, validateGraphql } from '../../graphql-request'; -import { DURATION_1_HOUR } from './deploy-velocity-constants'; +import { DURATION_90_MINUTES } from './deploy-velocity-constants'; -jest.setTimeout(DURATION_1_HOUR); +jest.setTimeout(DURATION_90_MINUTES); export type EndpointConfig = Pick; diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts index 84c2527a4d..6e476e09ce 100644 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/deploy-velocity/replace-2-gsis-100k-records.test.ts @@ -1,6 +1,6 @@ import { COUNT_100_THOUSAND, - DURATION_30_MINUTES, + DURATION_45_MINUTES, MUTATION_FOUR_FIELD_CREATE, SCHEMA_FOUR_FIELDS_FINAL_TWO_INDEXED, SCHEMA_FOUR_FIELDS_INITIAL_TWO_INDEXED, @@ -9,7 +9,7 @@ import { recordCountDataProvider, recordCountDataValidator, testManagedTableDepl testManagedTableDeployment({ name: 'Replace 2 GSIs updated - 100k Records', - maxDeployDurationMs: DURATION_30_MINUTES, + maxDeployDurationMs: DURATION_45_MINUTES, initialSchema: SCHEMA_FOUR_FIELDS_INITIAL_TWO_INDEXED, updatedSchema: SCHEMA_FOUR_FIELDS_FINAL_TWO_INDEXED, dataSetup: recordCountDataProvider(COUNT_100_THOUSAND, MUTATION_FOUR_FIELD_CREATE), diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-ddbrelated.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-ddbrelated.test.ts new file mode 100644 index 0000000000..842ca59d96 --- /dev/null +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-ddbrelated.test.ts @@ -0,0 +1,134 @@ +/* eslint-disable import/namespace */ +import { DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY } from '@aws-amplify/graphql-transformer-core'; +import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e-core'; +import * as fs from 'fs-extra'; +import * as generator from 'generate-password'; +import * as path from 'path'; +import { cdkDeploy, cdkDestroy, initCDKProject } from '../../../commands'; +import { SqlDatabaseDetails, SqlDatatabaseController } from '../../../sql-datatabase-controller'; +import { TestDefinition, dbDetailsToModelDataSourceStrategy, writeStackPrefix, writeTestDefinitions } from '../../../utils'; +import { + testPrimaryContainsAssociated, + testPrimaryCpkSkOneContainsAssociated, + testPrimaryCpkSkTwoContainAssociated, + testPrimaryMultipleHasOneContainsOneHasOne, + testRelatedManyContainsAssociated, + testRelatedManyCpkSkOneContainsAssociated, + testRelatedManypkSkTwoContainsAssociated, + testRelatedOneContainsAssociated, + testRelatedOneCpkSkOneContainsAssociated, + testRelatedOneCpkSkTwoContainsAssociated, +} from './test-implementations'; + +jest.setTimeout(1000 * 60 * 60 /* 1 hour */); + +describe('References relationships', () => { + const region = process.env.CLI_REGION ?? 'us-west-2'; + const baseProjFolderName = path.basename(__filename, '.test.ts'); + + describe('DDB Primary, DDB Related', () => { + const projFolderName = `${baseProjFolderName}-ddb-primary-ddb-related`; + let apiEndpoint: string; + let apiKey: string; + let projRoot: string; + let currentId: number; + + beforeEach(() => { + currentId = Date.now(); + }); + + beforeAll(async () => { + projRoot = await createNewProjectDir(projFolderName); + const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); + const name = await initCDKProject(projRoot, templatePath); + + const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); + const primarySchema = fs.readFileSync(primarySchemaPath).toString(); + + const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); + const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); + + const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); + const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); + + const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); + const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); + + const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); + const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); + + const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); + const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); + + const testDefinitions: Record = { + 'ddb-primary-ddb-related': { + schema: [primarySchema, relatedSchema, primarySchemaOneSk, relatedSchemaOneSk, primarySchemaTwoSk, relatedSchemaTwoSk].join('\n'), + strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, + }, + }; + + writeStackPrefix('RefDdbDdb', projRoot); + writeTestDefinitions(testDefinitions, projRoot); + + const outputs = await cdkDeploy(projRoot, '--all'); + apiEndpoint = outputs[name].awsAppsyncApiEndpoint; + apiKey = outputs[name].awsAppsyncApiKey; + }); + + afterAll(async () => { + try { + await cdkDestroy(projRoot, '--all'); + } catch (err) { + console.log(`Error invoking 'cdk destroy': ${err}`); + } + + deleteProjectDir(projRoot); + }); + + describe('Primary as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { + await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedOne as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedMany as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + }); +}); diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-sqlrelated.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-sqlrelated.test.ts new file mode 100644 index 0000000000..4f1d5948a9 --- /dev/null +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-ddbprimary-sqlrelated.test.ts @@ -0,0 +1,194 @@ +/* eslint-disable import/namespace */ +import { DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY } from '@aws-amplify/graphql-transformer-core'; +import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e-core'; +import * as fs from 'fs-extra'; +import * as generator from 'generate-password'; +import * as path from 'path'; +import { cdkDeploy, cdkDestroy, initCDKProject } from '../../../commands'; +import { SqlDatabaseDetails, SqlDatatabaseController } from '../../../sql-datatabase-controller'; +import { TestDefinition, dbDetailsToModelDataSourceStrategy, writeStackPrefix, writeTestDefinitions } from '../../../utils'; +import { + testPrimaryContainsAssociated, + testPrimaryCpkSkOneContainsAssociated, + testPrimaryCpkSkTwoContainAssociated, + testPrimaryMultipleHasOneContainsOneHasOne, + testRelatedManyContainsAssociated, + testRelatedManyCpkSkOneContainsAssociated, + testRelatedManypkSkTwoContainsAssociated, + testRelatedOneContainsAssociated, + testRelatedOneCpkSkOneContainsAssociated, + testRelatedOneCpkSkTwoContainsAssociated, +} from './test-implementations'; + +jest.setTimeout(1000 * 60 * 60 /* 1 hour */); + +describe('References relationships', () => { + const region = process.env.CLI_REGION ?? 'us-west-2'; + const baseProjFolderName = path.basename(__filename, '.test.ts'); + + const [dbUsername, dbIdentifier] = generator.generateMultiple(2); + const dbname = 'default_db'; + let dbDetails: SqlDatabaseDetails; + + // Note that the SQL database is created with slightly non-standard naming conventions, to avoid us having to use `refersTo` in the schema + // snippets. That allows us to reuse the same snippets across both DDB and SQL data sources, simplifying the test fixture data. + const databaseController = new SqlDatatabaseController( + [ + 'drop table if exists `RelatedMany`;', + 'drop table if exists `RelatedOne`;', + 'drop table if exists `Primary`;', + + // Single primary key + 'create table `Primary` ( id varchar(64) primary key not null );', + + 'create table `RelatedMany`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedMany_primaryId` on `RelatedMany`(`primaryId`);', + + 'create table `RelatedOne`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedOne_primaryId` on `RelatedOne`(`primaryId`);', + + // Two primary keys + 'create table `PrimaryCPKSKOne` ( id varchar(64) not null, skOne varchar(64) not null, PRIMARY KEY (`id`, `skOne`) );', + + 'create table `RelatedManyCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedManyCPKSKOne_primaryId_skOne` on `RelatedManyCPKSKOne`(`primaryId`, `primarySkOne`);', + + 'create table `RelatedOneCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedOnCPKSKOne_primaryId_skOne` on `RelatedOneCPKSKOne`(`primaryId`, `primarySkOne`);', + + // Three primary keys + 'create table `PrimaryCPKSKTwo` ( id varchar(64) not null, skOne varchar(64) not null, skTwo varchar(64) not null, PRIMARY KEY (`id`, `skOne`, `skTwo`) );', + + 'create table `RelatedManyCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedManyCPKSKTwo` on `RelatedManyCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + + 'create table `RelatedOneCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedOnCPKSKTwo_primaryId_skOne` on `RelatedOneCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + ], + { + identifier: dbIdentifier, + engine: 'mysql', + dbname, + username: dbUsername, + region, + }, + ); + + beforeAll(async () => { + dbDetails = await databaseController.setupDatabase(); + }); + + afterAll(async () => { + await databaseController.cleanupDatabase(); + }); + + describe('DDB Primary, SQL Related', () => { + const projFolderName = `${baseProjFolderName}-ddb-primary-sql-related`; + let apiEndpoint: string; + let apiKey: string; + let projRoot: string; + let currentId: number; + + beforeEach(() => { + currentId = Date.now(); + }); + + beforeAll(async () => { + projRoot = await createNewProjectDir(projFolderName); + const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); + const name = await initCDKProject(projRoot, templatePath); + + const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); + const primarySchema = fs.readFileSync(primarySchemaPath).toString(); + + const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); + const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); + + const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); + const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); + + const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); + const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); + + const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); + const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); + + const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); + const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); + + const testDefinitions: Record = { + 'ddb-primary': { + schema: [primarySchema, primarySchemaOneSk, primarySchemaTwoSk].join('\n'), + strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, + }, + 'sql-related': { + schema: [relatedSchema, relatedSchemaOneSk, relatedSchemaTwoSk].join('\n'), + strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlrelated', 'MYSQL', 'secretsManagerManagedSecret'), + }, + }; + + writeStackPrefix('RefSqlDdb', projRoot); + writeTestDefinitions(testDefinitions, projRoot); + + const outputs = await cdkDeploy(projRoot, '--all'); + apiEndpoint = outputs[name].awsAppsyncApiEndpoint; + apiKey = outputs[name].awsAppsyncApiKey; + }); + + afterAll(async () => { + try { + await cdkDestroy(projRoot, '--all'); + } catch (err) { + console.log(`Error invoking 'cdk destroy': ${err}`); + } + + deleteProjectDir(projRoot); + }); + + describe('Primary as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { + await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedOne as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedMany as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + }); +}); diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-ddbrelated.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-ddbrelated.test.ts new file mode 100644 index 0000000000..c85843cdc3 --- /dev/null +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-ddbrelated.test.ts @@ -0,0 +1,194 @@ +/* eslint-disable import/namespace */ +import { DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY } from '@aws-amplify/graphql-transformer-core'; +import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e-core'; +import * as fs from 'fs-extra'; +import * as generator from 'generate-password'; +import * as path from 'path'; +import { cdkDeploy, cdkDestroy, initCDKProject } from '../../../commands'; +import { SqlDatabaseDetails, SqlDatatabaseController } from '../../../sql-datatabase-controller'; +import { TestDefinition, dbDetailsToModelDataSourceStrategy, writeStackPrefix, writeTestDefinitions } from '../../../utils'; +import { + testPrimaryContainsAssociated, + testPrimaryCpkSkOneContainsAssociated, + testPrimaryCpkSkTwoContainAssociated, + testPrimaryMultipleHasOneContainsOneHasOne, + testRelatedManyContainsAssociated, + testRelatedManyCpkSkOneContainsAssociated, + testRelatedManypkSkTwoContainsAssociated, + testRelatedOneContainsAssociated, + testRelatedOneCpkSkOneContainsAssociated, + testRelatedOneCpkSkTwoContainsAssociated, +} from './test-implementations'; + +jest.setTimeout(1000 * 60 * 60 /* 1 hour */); + +describe('References relationships', () => { + const region = process.env.CLI_REGION ?? 'us-west-2'; + const baseProjFolderName = path.basename(__filename, '.test.ts'); + + const [dbUsername, dbIdentifier] = generator.generateMultiple(2); + const dbname = 'default_db'; + let dbDetails: SqlDatabaseDetails; + + // Note that the SQL database is created with slightly non-standard naming conventions, to avoid us having to use `refersTo` in the schema + // snippets. That allows us to reuse the same snippets across both DDB and SQL data sources, simplifying the test fixture data. + const databaseController = new SqlDatatabaseController( + [ + 'drop table if exists `RelatedMany`;', + 'drop table if exists `RelatedOne`;', + 'drop table if exists `Primary`;', + + // Single primary key + 'create table `Primary` ( id varchar(64) primary key not null );', + + 'create table `RelatedMany`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedMany_primaryId` on `RelatedMany`(`primaryId`);', + + 'create table `RelatedOne`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedOne_primaryId` on `RelatedOne`(`primaryId`);', + + // Two primary keys + 'create table `PrimaryCPKSKOne` ( id varchar(64) not null, skOne varchar(64) not null, PRIMARY KEY (`id`, `skOne`) );', + + 'create table `RelatedManyCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedManyCPKSKOne_primaryId_skOne` on `RelatedManyCPKSKOne`(`primaryId`, `primarySkOne`);', + + 'create table `RelatedOneCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedOnCPKSKOne_primaryId_skOne` on `RelatedOneCPKSKOne`(`primaryId`, `primarySkOne`);', + + // Three primary keys + 'create table `PrimaryCPKSKTwo` ( id varchar(64) not null, skOne varchar(64) not null, skTwo varchar(64) not null, PRIMARY KEY (`id`, `skOne`, `skTwo`) );', + + 'create table `RelatedManyCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedManyCPKSKTwo` on `RelatedManyCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + + 'create table `RelatedOneCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedOnCPKSKTwo_primaryId_skOne` on `RelatedOneCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + ], + { + identifier: dbIdentifier, + engine: 'mysql', + dbname, + username: dbUsername, + region, + }, + ); + + beforeAll(async () => { + dbDetails = await databaseController.setupDatabase(); + }); + + afterAll(async () => { + await databaseController.cleanupDatabase(); + }); + + describe('SQL Primary, DDB Related', () => { + const projFolderName = `${baseProjFolderName}-sql-primary-ddb-related`; + let apiEndpoint: string; + let apiKey: string; + let projRoot: string; + let currentId: number; + + beforeEach(() => { + currentId = Date.now(); + }); + + beforeAll(async () => { + projRoot = await createNewProjectDir(projFolderName); + const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); + const name = await initCDKProject(projRoot, templatePath); + + const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); + const primarySchema = fs.readFileSync(primarySchemaPath).toString(); + + const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); + const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); + + const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); + const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); + + const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); + const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); + + const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); + const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); + + const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); + const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); + + const testDefinitions: Record = { + 'sql-primary': { + schema: [primarySchema, primarySchemaOneSk, primarySchemaTwoSk].join('\n'), + strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlprimary', 'MYSQL', 'secretsManagerManagedSecret'), + }, + 'ddb-related': { + schema: [relatedSchema, relatedSchemaOneSk, relatedSchemaTwoSk].join('\n'), + strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, + }, + }; + + writeStackPrefix('RefSqlDdb', projRoot); + writeTestDefinitions(testDefinitions, projRoot); + + const outputs = await cdkDeploy(projRoot, '--all'); + apiEndpoint = outputs[name].awsAppsyncApiEndpoint; + apiKey = outputs[name].awsAppsyncApiKey; + }); + + afterAll(async () => { + try { + await cdkDestroy(projRoot, '--all'); + } catch (err) { + console.log(`Error invoking 'cdk destroy': ${err}`); + } + + deleteProjectDir(projRoot); + }); + + describe('Primary as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { + await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedOne as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedMany as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + }); +}); diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-sqlrelated.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-sqlrelated.test.ts new file mode 100644 index 0000000000..89bc373d12 --- /dev/null +++ b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references-sqlprimary-sqlrelated.test.ts @@ -0,0 +1,189 @@ +/* eslint-disable import/namespace */ +import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e-core'; +import * as fs from 'fs-extra'; +import * as generator from 'generate-password'; +import * as path from 'path'; +import { cdkDeploy, cdkDestroy, initCDKProject } from '../../../commands'; +import { SqlDatabaseDetails, SqlDatatabaseController } from '../../../sql-datatabase-controller'; +import { TestDefinition, dbDetailsToModelDataSourceStrategy, writeStackPrefix, writeTestDefinitions } from '../../../utils'; +import { + testPrimaryContainsAssociated, + testPrimaryCpkSkOneContainsAssociated, + testPrimaryCpkSkTwoContainAssociated, + testPrimaryMultipleHasOneContainsOneHasOne, + testRelatedManyContainsAssociated, + testRelatedManyCpkSkOneContainsAssociated, + testRelatedManypkSkTwoContainsAssociated, + testRelatedOneContainsAssociated, + testRelatedOneCpkSkOneContainsAssociated, + testRelatedOneCpkSkTwoContainsAssociated, +} from './test-implementations'; + +jest.setTimeout(1000 * 60 * 60 /* 1 hour */); + +describe('References relationships', () => { + const region = process.env.CLI_REGION ?? 'us-west-2'; + const baseProjFolderName = path.basename(__filename, '.test.ts'); + + const [dbUsername, dbIdentifier] = generator.generateMultiple(2); + const dbname = 'default_db'; + let dbDetails: SqlDatabaseDetails; + + // Note that the SQL database is created with slightly non-standard naming conventions, to avoid us having to use `refersTo` in the schema + // snippets. That allows us to reuse the same snippets across both DDB and SQL data sources, simplifying the test fixture data. + const databaseController = new SqlDatatabaseController( + [ + 'drop table if exists `RelatedMany`;', + 'drop table if exists `RelatedOne`;', + 'drop table if exists `Primary`;', + + // Single primary key + 'create table `Primary` ( id varchar(64) primary key not null );', + + 'create table `RelatedMany`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedMany_primaryId` on `RelatedMany`(`primaryId`);', + + 'create table `RelatedOne`( id varchar(64) primary key not null, `primaryId` varchar(64));', + 'create index `RelatedOne_primaryId` on `RelatedOne`(`primaryId`);', + + // Two primary keys + 'create table `PrimaryCPKSKOne` ( id varchar(64) not null, skOne varchar(64) not null, PRIMARY KEY (`id`, `skOne`) );', + + 'create table `RelatedManyCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedManyCPKSKOne_primaryId_skOne` on `RelatedManyCPKSKOne`(`primaryId`, `primarySkOne`);', + + 'create table `RelatedOneCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', + 'create index `RelatedOnCPKSKOne_primaryId_skOne` on `RelatedOneCPKSKOne`(`primaryId`, `primarySkOne`);', + + // Three primary keys + 'create table `PrimaryCPKSKTwo` ( id varchar(64) not null, skOne varchar(64) not null, skTwo varchar(64) not null, PRIMARY KEY (`id`, `skOne`, `skTwo`) );', + + 'create table `RelatedManyCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedManyCPKSKTwo` on `RelatedManyCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + + 'create table `RelatedOneCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', + 'create index `RelatedOnCPKSKTwo_primaryId_skOne` on `RelatedOneCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', + ], + { + identifier: dbIdentifier, + engine: 'mysql', + dbname, + username: dbUsername, + region, + }, + ); + + beforeAll(async () => { + dbDetails = await databaseController.setupDatabase(); + }); + + afterAll(async () => { + await databaseController.cleanupDatabase(); + }); + + describe('SQL Primary, SQL Related', () => { + const projFolderName = `${baseProjFolderName}-sql-primary-sql-related`; + let apiEndpoint: string; + let apiKey: string; + let projRoot: string; + let currentId: number; + + beforeEach(() => { + currentId = Date.now(); + }); + + beforeAll(async () => { + projRoot = await createNewProjectDir(projFolderName); + const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); + const name = await initCDKProject(projRoot, templatePath); + + const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); + const primarySchema = fs.readFileSync(primarySchemaPath).toString(); + + const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); + const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); + + const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); + const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); + + const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); + const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); + + const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); + const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); + + const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); + const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); + + const testDefinitions: Record = { + 'sql-primary-sql-related': { + schema: [primarySchema, relatedSchema, primarySchemaOneSk, relatedSchemaOneSk, primarySchemaTwoSk, relatedSchemaTwoSk].join('\n'), + strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlprimarysqlrelated', 'MYSQL', 'secretsManagerManagedSecret'), + }, + }; + + writeStackPrefix('RefSqlSql', projRoot); + writeTestDefinitions(testDefinitions, projRoot); + + const outputs = await cdkDeploy(projRoot, '--all'); + apiEndpoint = outputs[name].awsAppsyncApiEndpoint; + apiKey = outputs[name].awsAppsyncApiKey; + }); + + afterAll(async () => { + try { + await cdkDestroy(projRoot, '--all'); + } catch (err) { + console.log(`Error invoking 'cdk destroy': ${err}`); + } + + deleteProjectDir(projRoot); + }); + + describe('Primary as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { + await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedOne as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + + describe('RelatedMany as source', () => { + test('Associated models included in query and mutation response with single primary key', async () => { + await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with one sort key', async () => { + await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); + }); + + test('Associated models included in query and mutation response with two sort keys', async () => { + await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); + }); + }); + }); +}); diff --git a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references.test.ts b/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references.test.ts deleted file mode 100644 index 59546d5d78..0000000000 --- a/packages/amplify-graphql-api-construct-tests/src/__tests__/relationships/references/references.test.ts +++ /dev/null @@ -1,516 +0,0 @@ -/* eslint-disable import/namespace */ -import { DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY } from '@aws-amplify/graphql-transformer-core'; -import { createNewProjectDir, deleteProjectDir } from 'amplify-category-api-e2e-core'; -import * as fs from 'fs-extra'; -import * as generator from 'generate-password'; -import * as path from 'path'; -import { cdkDeploy, cdkDestroy, initCDKProject } from '../../../commands'; -import { SqlDatabaseDetails, SqlDatatabaseController } from '../../../sql-datatabase-controller'; -import { TestDefinition, dbDetailsToModelDataSourceStrategy, writeStackPrefix, writeTestDefinitions } from '../../../utils'; -import { - testPrimaryContainsAssociated, - testPrimaryCpkSkOneContainsAssociated, - testPrimaryCpkSkTwoContainAssociated, - testPrimaryMultipleHasOneContainsOneHasOne, - testRelatedManyContainsAssociated, - testRelatedManyCpkSkOneContainsAssociated, - testRelatedManypkSkTwoContainsAssociated, - testRelatedOneContainsAssociated, - testRelatedOneCpkSkOneContainsAssociated, - testRelatedOneCpkSkTwoContainsAssociated, -} from './test-implementations'; - -jest.setTimeout(1000 * 60 * 60 /* 1 hour */); - -describe('References relationships', () => { - const region = process.env.CLI_REGION ?? 'us-west-2'; - const baseProjFolderName = path.basename(__filename, '.test.ts'); - - const [dbUsername, dbIdentifier] = generator.generateMultiple(2); - const dbname = 'default_db'; - let dbDetails: SqlDatabaseDetails; - - // Note that the SQL database is created with slightly non-standard naming conventions, to avoid us having to use `refersTo` in the schema - // snippets. That allows us to reuse the same snippets across both DDB and SQL data sources, simplifying the test fixture data. - const databaseController = new SqlDatatabaseController( - [ - 'drop table if exists `RelatedMany`;', - 'drop table if exists `RelatedOne`;', - 'drop table if exists `Primary`;', - - // Single primary key - 'create table `Primary` ( id varchar(64) primary key not null );', - - 'create table `RelatedMany`( id varchar(64) primary key not null, `primaryId` varchar(64));', - 'create index `RelatedMany_primaryId` on `RelatedMany`(`primaryId`);', - - 'create table `RelatedOne`( id varchar(64) primary key not null, `primaryId` varchar(64));', - 'create index `RelatedOne_primaryId` on `RelatedOne`(`primaryId`);', - - // Two primary keys - 'create table `PrimaryCPKSKOne` ( id varchar(64) not null, skOne varchar(64) not null, PRIMARY KEY (`id`, `skOne`) );', - - 'create table `RelatedManyCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', - 'create index `RelatedManyCPKSKOne_primaryId_skOne` on `RelatedManyCPKSKOne`(`primaryId`, `primarySkOne`);', - - 'create table `RelatedOneCPKSKOne`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64) );', - 'create index `RelatedOnCPKSKOne_primaryId_skOne` on `RelatedOneCPKSKOne`(`primaryId`, `primarySkOne`);', - - // Three primary keys - 'create table `PrimaryCPKSKTwo` ( id varchar(64) not null, skOne varchar(64) not null, skTwo varchar(64) not null, PRIMARY KEY (`id`, `skOne`, `skTwo`) );', - - 'create table `RelatedManyCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', - 'create index `RelatedManyCPKSKTwo` on `RelatedManyCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', - - 'create table `RelatedOneCPKSKTwo`( id varchar(64) primary key not null, `primaryId` varchar(64), `primarySkOne` varchar(64), `primarySkTwo` varchar(64) );', - 'create index `RelatedOnCPKSKTwo_primaryId_skOne` on `RelatedOneCPKSKTwo`(`primaryId`, `primarySkOne`, `primarySkTwo`);', - ], - { - identifier: dbIdentifier, - engine: 'mysql', - dbname, - username: dbUsername, - region, - }, - ); - - beforeAll(async () => { - dbDetails = await databaseController.setupDatabase(); - }); - - afterAll(async () => { - await databaseController.cleanupDatabase(); - }); - - describe('DDB Primary, DDB Related', () => { - const projFolderName = `${baseProjFolderName}-ddb-primary-ddb-related`; - let apiEndpoint: string; - let apiKey: string; - let projRoot: string; - let currentId: number; - - beforeEach(() => { - currentId = Date.now(); - }); - - beforeAll(async () => { - projRoot = await createNewProjectDir(projFolderName); - const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); - const name = await initCDKProject(projRoot, templatePath); - - const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); - const primarySchema = fs.readFileSync(primarySchemaPath).toString(); - - const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); - const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); - - const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); - const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); - - const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); - const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); - - const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); - const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); - - const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); - const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); - - const testDefinitions: Record = { - 'ddb-primary-ddb-related': { - schema: [primarySchema, relatedSchema, primarySchemaOneSk, relatedSchemaOneSk, primarySchemaTwoSk, relatedSchemaTwoSk].join('\n'), - strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, - }, - }; - - writeStackPrefix('RefDdbDdb', projRoot); - writeTestDefinitions(testDefinitions, projRoot); - - const outputs = await cdkDeploy(projRoot, '--all'); - apiEndpoint = outputs[name].awsAppsyncApiEndpoint; - apiKey = outputs[name].awsAppsyncApiKey; - }); - - afterAll(async () => { - try { - await cdkDestroy(projRoot, '--all'); - } catch (err) { - console.log(`Error invoking 'cdk destroy': ${err}`); - } - - deleteProjectDir(projRoot); - }); - - describe('Primary as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { - await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedOne as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedMany as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - }); - - describe('SQL Primary, SQL Related', () => { - const projFolderName = `${baseProjFolderName}-sql-primary-sql-related`; - let apiEndpoint: string; - let apiKey: string; - let projRoot: string; - let currentId: number; - - beforeEach(() => { - currentId = Date.now(); - }); - - beforeAll(async () => { - projRoot = await createNewProjectDir(projFolderName); - const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); - const name = await initCDKProject(projRoot, templatePath); - - const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); - const primarySchema = fs.readFileSync(primarySchemaPath).toString(); - - const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); - const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); - - const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); - const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); - - const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); - const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); - - const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); - const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); - - const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); - const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); - - const testDefinitions: Record = { - 'sql-primary-sql-related': { - schema: [primarySchema, relatedSchema, primarySchemaOneSk, relatedSchemaOneSk, primarySchemaTwoSk, relatedSchemaTwoSk].join('\n'), - strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlprimarysqlrelated', 'MYSQL', 'secretsManagerManagedSecret'), - }, - }; - - writeStackPrefix('RefSqlSql', projRoot); - writeTestDefinitions(testDefinitions, projRoot); - - const outputs = await cdkDeploy(projRoot, '--all'); - apiEndpoint = outputs[name].awsAppsyncApiEndpoint; - apiKey = outputs[name].awsAppsyncApiKey; - }); - - afterAll(async () => { - try { - await cdkDestroy(projRoot, '--all'); - } catch (err) { - console.log(`Error invoking 'cdk destroy': ${err}`); - } - - deleteProjectDir(projRoot); - }); - - describe('Primary as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { - await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedOne as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedMany as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - }); - - describe('SQL Primary, DDB Related', () => { - const projFolderName = `${baseProjFolderName}-sql-primary-ddb-related`; - let apiEndpoint: string; - let apiKey: string; - let projRoot: string; - let currentId: number; - - beforeEach(() => { - currentId = Date.now(); - }); - - beforeAll(async () => { - projRoot = await createNewProjectDir(projFolderName); - const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); - const name = await initCDKProject(projRoot, templatePath); - - const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); - const primarySchema = fs.readFileSync(primarySchemaPath).toString(); - - const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); - const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); - - const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); - const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); - - const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); - const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); - - const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); - const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); - - const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); - const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); - - const testDefinitions: Record = { - 'sql-primary': { - schema: [primarySchema, primarySchemaOneSk, primarySchemaTwoSk].join('\n'), - strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlprimary', 'MYSQL', 'secretsManagerManagedSecret'), - }, - 'ddb-related': { - schema: [relatedSchema, relatedSchemaOneSk, relatedSchemaTwoSk].join('\n'), - strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, - }, - }; - - writeStackPrefix('RefSqlDdb', projRoot); - writeTestDefinitions(testDefinitions, projRoot); - - const outputs = await cdkDeploy(projRoot, '--all'); - apiEndpoint = outputs[name].awsAppsyncApiEndpoint; - apiKey = outputs[name].awsAppsyncApiKey; - }); - - afterAll(async () => { - try { - await cdkDestroy(projRoot, '--all'); - } catch (err) { - console.log(`Error invoking 'cdk destroy': ${err}`); - } - - deleteProjectDir(projRoot); - }); - - describe('Primary as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { - await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedOne as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedMany as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - }); - - describe('DDB Primary, SQL Related', () => { - const projFolderName = `${baseProjFolderName}-ddb-primary-sql-related`; - let apiEndpoint: string; - let apiKey: string; - let projRoot: string; - let currentId: number; - - beforeEach(() => { - currentId = Date.now(); - }); - - beforeAll(async () => { - projRoot = await createNewProjectDir(projFolderName); - const templatePath = path.resolve(path.join(__dirname, '..', '..', 'backends', 'configurable-sandbox-stack')); - const name = await initCDKProject(projRoot, templatePath); - - const primarySchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary.graphql')); - const primarySchema = fs.readFileSync(primarySchemaPath).toString(); - - const relatedSchemaPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related.graphql')); - const relatedSchema = fs.readFileSync(relatedSchemaPath).toString(); - - const primarySchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-1sk.graphql')); - const primarySchemaOneSk = fs.readFileSync(primarySchemaOneSkPath).toString(); - - const relatedSchemaOneSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-1sk.graphql')); - const relatedSchemaOneSk = fs.readFileSync(relatedSchemaOneSkPath).toString(); - - const primarySchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-primary-cpk-2sk.graphql')); - const primarySchemaTwoSk = fs.readFileSync(primarySchemaTwoSkPath).toString(); - - const relatedSchemaTwoSkPath = path.resolve(path.join(__dirname, 'graphql', 'schema-related-cpk-2sk.graphql')); - const relatedSchemaTwoSk = fs.readFileSync(relatedSchemaTwoSkPath).toString(); - - const testDefinitions: Record = { - 'ddb-primary': { - schema: [primarySchema, primarySchemaOneSk, primarySchemaTwoSk].join('\n'), - strategy: DDB_AMPLIFY_MANAGED_DATASOURCE_STRATEGY, - }, - 'sql-related': { - schema: [relatedSchema, relatedSchemaOneSk, relatedSchemaTwoSk].join('\n'), - strategy: dbDetailsToModelDataSourceStrategy(dbDetails, 'sqlrelated', 'MYSQL', 'secretsManagerManagedSecret'), - }, - }; - - writeStackPrefix('RefSqlDdb', projRoot); - writeTestDefinitions(testDefinitions, projRoot); - - const outputs = await cdkDeploy(projRoot, '--all'); - apiEndpoint = outputs[name].awsAppsyncApiEndpoint; - apiKey = outputs[name].awsAppsyncApiKey; - }); - - afterAll(async () => { - try { - await cdkDestroy(projRoot, '--all'); - } catch (err) { - console.log(`Error invoking 'cdk destroy': ${err}`); - } - - deleteProjectDir(projRoot); - }); - - describe('Primary as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testPrimaryContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testPrimaryCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testPrimaryCpkSkTwoContainAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Multiple RelatedOne associated records returns one RelatedOne record', async () => { - await testPrimaryMultipleHasOneContainsOneHasOne(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedOne as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedOneCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedOneCpkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - - describe('RelatedMany as source', () => { - test('Associated models included in query and mutation response with single primary key', async () => { - await testRelatedManyContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with one sort key', async () => { - await testRelatedManyCpkSkOneContainsAssociated(currentId, apiEndpoint, apiKey); - }); - - test('Associated models included in query and mutation response with two sort keys', async () => { - await testRelatedManypkSkTwoContainsAssociated(currentId, apiEndpoint, apiKey); - }); - }); - }); -}); diff --git a/scripts/split-e2e-tests.ts b/scripts/split-e2e-tests.ts index 277a635ce4..a2862c3f2e 100644 --- a/scripts/split-e2e-tests.ts +++ b/scripts/split-e2e-tests.ts @@ -146,6 +146,8 @@ const RUN_SOLO: (string | RegExp)[] = [ 'src/__tests__/default-ddb-canary.test.ts', /src\/__tests__\/group-auth\/.*\.test\.ts/, /src\/__tests__\/owner-auth\/.*\.test\.ts/, + /src\/__tests__\/relationships\/.*\.test\.ts/, + /src\/__tests__\/restricted-field-auth\/.*\.test\.ts/, ]; const RUN_IN_ALL_REGIONS = [