gooddata 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.document +0 -0
- data/.flayignore +2 -0
- data/.travis.yml +24 -7
- data/.yardopts +0 -0
- data/CHANGELOG.md +125 -1
- data/CLI.md +0 -0
- data/Dockerfile.jruby +7 -2
- data/Dockerfile.ruby +1 -1
- data/Gemfile +0 -0
- data/Guardfile +0 -0
- data/Rakefile +23 -9
- data/TODO.md +0 -0
- data/bin/gitflow-init.sh +8 -0
- data/ci.rake +3 -3
- data/data/2008.crt +39 -0
- data/data/new_ca.cer +22 -0
- data/dependency_decisions.yml +0 -0
- data/docker-compose.lcm.yml +31 -0
- data/docker-compose.yml +4 -2
- data/gooddata.gemspec +3 -3
- data/lcm.rake +288 -0
- data/lib/gooddata.rb +1 -0
- data/lib/gooddata/bricks/base_downloader.rb +1 -1
- data/lib/gooddata/bricks/brick.rb +0 -1
- data/lib/gooddata/bricks/middleware/aws_middleware.rb +1 -1
- data/lib/gooddata/bricks/middleware/logger_middleware.rb +1 -1
- data/lib/gooddata/bricks/pipeline.rb +67 -0
- data/lib/gooddata/bricks/provisioning_brick.rb +18 -0
- data/lib/gooddata/bricks/release_brick.rb +18 -0
- data/lib/gooddata/bricks/rollout_brick.rb +14 -0
- data/lib/gooddata/bricks/user_filters_brick.rb +13 -0
- data/lib/gooddata/bricks/users_brick.rb +13 -0
- data/lib/gooddata/core/logging.rb +1 -1
- data/lib/gooddata/exceptions/maql_execution.rb +1 -1
- data/lib/gooddata/extensions/string.rb +0 -0
- data/lib/gooddata/lcm/actions/associate_clients.rb +34 -8
- data/lib/gooddata/lcm/actions/collect_data_product.rb +8 -1
- data/lib/gooddata/lcm/actions/collect_segment_clients.rb +13 -23
- data/lib/gooddata/lcm/actions/collect_segments.rb +10 -0
- data/lib/gooddata/lcm/actions/synchronize_clients.rb +3 -1
- data/lib/gooddata/lcm/actions/synchronize_ldm.rb +61 -34
- data/lib/gooddata/lcm/actions/synchronize_user_filters.rb +6 -4
- data/lib/gooddata/lcm/actions/update_release_table.rb +4 -12
- data/lib/gooddata/lcm/dsl/params_dsl.rb +0 -4
- data/lib/gooddata/lcm/dsl/type_dsl.rb +0 -4
- data/lib/gooddata/lcm/helpers/check_helper.rb +1 -1
- data/lib/gooddata/lcm/lcm2.rb +0 -2
- data/lib/gooddata/lcm/types/special/enum.rb +6 -0
- data/lib/gooddata/lcm/types/special/enum/synchronize_ldm.rb +20 -0
- data/lib/gooddata/lcm/types/special/types.rb +1 -1
- data/lib/gooddata/mixins/is_folder.rb +0 -0
- data/lib/gooddata/mixins/to_json.rb +0 -0
- data/lib/gooddata/mixins/uri_getter.rb +0 -0
- data/lib/gooddata/models/project_creator.rb +38 -30
- data/lib/gooddata/models/user_filters/user_filter_builder.rb +1 -0
- data/lib/gooddata/rest/README.md +0 -0
- data/lib/gooddata/version.rb +1 -1
- data/lib/templates/bricks/brick.rb.erb +0 -0
- data/lib/templates/bricks/main.rb.erb +0 -0
- data/lib/templates/project/Goodfile.erb +0 -0
- data/lib/templates/project/data/commits.csv +0 -0
- data/lib/templates/project/data/devs.csv +0 -0
- data/lib/templates/project/data/repos.csv +0 -0
- data/lib/templates/project/model/model.rb.erb +0 -0
- metadata +21 -451
- data/lib/gooddata/lcm/actions/ensure_data_product.rb +0 -63
- data/spec/.rubocop.yml +0 -16
- data/spec/bricks/bricks_spec.rb +0 -110
- data/spec/bricks/default-config.json +0 -8
- data/spec/data/.gooddata +0 -4
- data/spec/data/blueprints/additional_dataset_module.json +0 -32
- data/spec/data/blueprints/attribute_sort_order_blueprint.json +0 -72
- data/spec/data/blueprints/big_blueprint_not_pruned.json +0 -2079
- data/spec/data/blueprints/invalid_blueprint.json +0 -103
- data/spec/data/blueprints/m_n_model.json +0 -104
- data/spec/data/blueprints/model_module.json +0 -25
- data/spec/data/blueprints/test_blueprint.json +0 -39
- data/spec/data/blueprints/test_project_model_spec.json +0 -106
- data/spec/data/cc/data/source/commits.csv +0 -4
- data/spec/data/cc/data/source/devs.csv +0 -4
- data/spec/data/cc/data/source/repos.csv +0 -3
- data/spec/data/cc/devel.prm +0 -0
- data/spec/data/cc/graph/graph.grf +0 -11
- data/spec/data/cc/workspace.prm +0 -19
- data/spec/data/column_based_permissions.csv +0 -7
- data/spec/data/column_based_permissions2.csv +0 -6
- data/spec/data/dynamic_schedule_params_table.csv +0 -7
- data/spec/data/gd_gse_data_blueprint.json +0 -1371
- data/spec/data/gd_gse_data_manifest.json +0 -1424
- data/spec/data/gd_gse_data_model.json +0 -1772
- data/spec/data/gooddata_version_process/gooddata_version.rb +0 -9
- data/spec/data/gooddata_version_process/gooddata_version.zip +0 -0
- data/spec/data/hello_world_process/hello_world.rb +0 -9
- data/spec/data/hello_world_process/hello_world.zip +0 -0
- data/spec/data/integration_model.json +0 -252
- data/spec/data/integration_policies.csv +0 -9134
- data/spec/data/line_based_permissions.csv +0 -3
- data/spec/data/manifests/test_blueprint.json +0 -32
- data/spec/data/manifests/test_project.json +0 -107
- data/spec/data/reports/left_attr_report.json +0 -108
- data/spec/data/reports/metric_only_one_line.json +0 -83
- data/spec/data/reports/report_1.json +0 -197
- data/spec/data/reports/top_attr_report.json +0 -108
- data/spec/data/ruby_params_process/ruby_params.rb +0 -9
- data/spec/data/ruby_process/deep_files/deep_stuff.txt +0 -1
- data/spec/data/ruby_process/process.rb +0 -8
- data/spec/data/ruby_process/stuff.txt +0 -1
- data/spec/data/superfluous_titles_view.json +0 -81
- data/spec/data/test-ci-data.csv +0 -2
- data/spec/data/user_filters.csv +0 -2
- data/spec/data/users.csv +0 -12
- data/spec/data/wire_models/attribute_sort_by_model.json +0 -73
- data/spec/data/wire_models/model_view.json +0 -1775
- data/spec/data/wire_models/nu_model.json +0 -3046
- data/spec/data/wire_models/test_blueprint.json +0 -66
- data/spec/data/wire_test_project.json +0 -150
- data/spec/data/workspace_table.csv +0 -3
- data/spec/environment/default.rb +0 -43
- data/spec/environment/development.rb +0 -32
- data/spec/environment/environment.rb +0 -38
- data/spec/environment/production.rb +0 -27
- data/spec/environment/staging.rb +0 -32
- data/spec/environment/testing.rb +0 -32
- data/spec/helpers/appstore_project_helper.rb +0 -221
- data/spec/helpers/blueprint_helper.rb +0 -27
- data/spec/helpers/cli_helper.rb +0 -38
- data/spec/helpers/connection_helper.rb +0 -43
- data/spec/helpers/constants.rb +0 -32
- data/spec/helpers/crypto_helper.rb +0 -19
- data/spec/helpers/csv_helper.rb +0 -20
- data/spec/helpers/process_helper.rb +0 -35
- data/spec/helpers/project_helper.rb +0 -74
- data/spec/helpers/schedule_helper.rb +0 -33
- data/spec/helpers/spec_helper.rb +0 -17
- data/spec/integration/ads_output_stage_spec.rb +0 -45
- data/spec/integration/blueprint_updates_spec.rb +0 -107
- data/spec/integration/blueprint_with_ca_spec.rb +0 -56
- data/spec/integration/blueprint_with_grain_spec.rb +0 -74
- data/spec/integration/channel_configuration_spec.rb +0 -67
- data/spec/integration/clients_spec.rb +0 -164
- data/spec/integration/command_datawarehouse_spec.rb +0 -45
- data/spec/integration/command_projects_spec.rb +0 -32
- data/spec/integration/commands/command_projects_spec.rb +0 -22
- data/spec/integration/connection_spec.rb +0 -37
- data/spec/integration/core/connection_spec.rb +0 -56
- data/spec/integration/core/logging_spec.rb +0 -132
- data/spec/integration/core/project_spec.rb +0 -54
- data/spec/integration/create_from_template_spec.rb +0 -29
- data/spec/integration/create_project_spec.rb +0 -27
- data/spec/integration/date_dim_switch_spec.rb +0 -154
- data/spec/integration/deprecated_load_spec.rb +0 -60
- data/spec/integration/full_process_schedule_spec.rb +0 -367
- data/spec/integration/full_project_spec.rb +0 -592
- data/spec/integration/helpers_spec.rb +0 -16
- data/spec/integration/lcm_spec.rb +0 -54
- data/spec/integration/mandatory_user_filter_spec.rb +0 -53
- data/spec/integration/mixins/id_to_uri_spec.rb +0 -56
- data/spec/integration/models/data_product_spec.rb +0 -71
- data/spec/integration/models/domain_spec.rb +0 -162
- data/spec/integration/models/invitation_spec.rb +0 -17
- data/spec/integration/models/label_spec.rb +0 -49
- data/spec/integration/models/membership_spec.rb +0 -127
- data/spec/integration/models/metadata/report_spec.rb +0 -54
- data/spec/integration/models/metric_spec.rb +0 -24
- data/spec/integration/models/params_spec.rb +0 -118
- data/spec/integration/models/process_spec.rb +0 -35
- data/spec/integration/models/profile_spec.rb +0 -210
- data/spec/integration/models/project_role_spec.rb +0 -94
- data/spec/integration/models/project_spec.rb +0 -225
- data/spec/integration/models/schedule_spec.rb +0 -477
- data/spec/integration/models/unit_project_spec.rb +0 -130
- data/spec/integration/over_to_user_filters_spec.rb +0 -98
- data/spec/integration/partial_md_export_import_spec.rb +0 -41
- data/spec/integration/project_spec.rb +0 -381
- data/spec/integration/rest_spec.rb +0 -214
- data/spec/integration/schedule_spec.rb +0 -611
- data/spec/integration/segments_spec.rb +0 -100
- data/spec/integration/subscription_spec.rb +0 -88
- data/spec/integration/urn_date_dim_spec.rb +0 -53
- data/spec/integration/user_filters_spec.rb +0 -310
- data/spec/integration/user_group_spec.rb +0 -147
- data/spec/integration/variables_spec.rb +0 -189
- data/spec/integration/vcr_cassettes/GoodData_-_logging/_logger/can_assign_a_custom_logger.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_-_logging/_logger/client_logs_when_given_custom_message.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_-_logging/_logger/has_the_request_id_logged_when_I_passed_it.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_-_logging/_logging_off/Disables_logging.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_-_logging/_logging_on/Enables_logging.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_-_project/_project/Returns_project_assigned.yml +0 -354
- data/spec/integration/vcr_cassettes/GoodData_-_project/_project_/Assigns_nil.yml +0 -299
- data/spec/integration/vcr_cassettes/GoodData_-_project/_project_/Assigns_project_directly.yml +0 -354
- data/spec/integration/vcr_cassettes/GoodData_-_project/_project_/Assigns_project_using_project_ID.yml +0 -354
- data/spec/integration/vcr_cassettes/GoodData_-_project/_project_/Assigns_project_using_project_URL.yml +0 -354
- data/spec/integration/vcr_cassettes/GoodData_-_project/_with_project/Uses_project_specified.yml +0 -354
- data/spec/integration/vcr_cassettes/GoodData_Metric/all.yml +0 -2065
- data/spec/integration/vcr_cassettes/GoodData_Metric/should_be_able_to_update_folders.yml +0 -119
- data/spec/integration/vcr_cassettes/GoodData_Mixin_MdIdToUri/all.yml +0 -9812
- data/spec/integration/vcr_cassettes/GoodData_Mixin_MdIdToUri/should_get_json_containing_correct_id.yml +0 -174
- data/spec/integration/vcr_cassettes/GoodData_Mixin_MdIdToUri/should_return_nil_for_unknown_id.yml +0 -58
- data/spec/integration/vcr_cassettes/GoodData_Mixin_MdIdToUri/should_throw_BadRequest_for_-1.yml +0 -63
- data/spec/integration/vcr_cassettes/GoodData_Rest_Connection/_connect/Connects_using_username_and_password.yml +0 -299
- data/spec/integration/vcr_cassettes/GoodData_Rest_Connection/_disconnect/Connects_using_username_and_password.yml +0 -299
- data/spec/integration/vcr_cassettes/GoodData_Rest_Connection/_generate_request_id/Generates_a_non-empty_string.yml +0 -2287
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_/Should_list_user_groups_as_Array.yml +0 -56
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_add_members/Should_add_member.yml +0 -315
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_members/Should_return_members_as_array.yml +0 -54
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_remove_members/Should_remove_existing_members.yml +0 -258
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_save/updates_existing_group.yml +0 -159
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/_set_members/Should_set_new_members.yml +0 -158
- data/spec/integration/vcr_cassettes/GoodData_UserGroup/all.yml +0 -809
- data/spec/logging_in_logging_out_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -110
- data/spec/unit/actions/associate_clients_spec.rb +0 -48
- data/spec/unit/actions/collect_client_projects_spec.rb +0 -47
- data/spec/unit/actions/collect_clients_spec.rb +0 -65
- data/spec/unit/actions/collect_data_product_spec.rb +0 -58
- data/spec/unit/actions/collect_dynamic_schedule_params_spec.rb +0 -56
- data/spec/unit/actions/collect_meta_spec.rb +0 -88
- data/spec/unit/actions/collect_segment_clients_spec.rb +0 -82
- data/spec/unit/actions/collect_tagged_objects_spec.rb +0 -126
- data/spec/unit/actions/collect_users_brick_users_spec.rb +0 -36
- data/spec/unit/actions/create_segment_masters_spec.rb +0 -65
- data/spec/unit/actions/ensure_data_product_spec.rb +0 -39
- data/spec/unit/actions/ensure_technical_users_domain_spec.rb +0 -53
- data/spec/unit/actions/ensure_technical_users_project_spec.rb +0 -76
- data/spec/unit/actions/execute_schedules_spec.rb +0 -94
- data/spec/unit/actions/provision_clients_spec.rb +0 -46
- data/spec/unit/actions/purge_clients_spec.rb +0 -47
- data/spec/unit/actions/rename_existing_client_projects_spec.rb +0 -54
- data/spec/unit/actions/segments_filter_spec.rb +0 -46
- data/spec/unit/actions/shared_examples_for_user_actions.rb +0 -43
- data/spec/unit/actions/synchronize_cas_spec.rb +0 -58
- data/spec/unit/actions/synchronize_clients_spec.rb +0 -71
- data/spec/unit/actions/synchronize_etls_in_segment_spec.rb +0 -206
- data/spec/unit/actions/synchronize_ldm_spec.rb +0 -70
- data/spec/unit/actions/synchronize_user_filters_spec.rb +0 -208
- data/spec/unit/actions/synchronize_user_groups_spec.rb +0 -49
- data/spec/unit/actions/synchronize_users_spec.rb +0 -180
- data/spec/unit/bricks/bricks_spec.rb +0 -34
- data/spec/unit/bricks/middleware/aws_middelware_spec.rb +0 -98
- data/spec/unit/bricks/middleware/bench_middleware_spec.rb +0 -15
- data/spec/unit/bricks/middleware/bulk_salesforce_middleware_spec.rb +0 -15
- data/spec/unit/bricks/middleware/gooddata_middleware_spec.rb +0 -15
- data/spec/unit/bricks/middleware/logger_middleware_spec.rb +0 -30
- data/spec/unit/bricks/middleware/restforce_middleware_spec.rb +0 -15
- data/spec/unit/bricks/middleware/stdout_middleware_spec.rb +0 -15
- data/spec/unit/bricks/middleware/twitter_middleware_spec.rb +0 -15
- data/spec/unit/cli/cli_spec.rb +0 -17
- data/spec/unit/cli/commands/cmd_auth_spec.rb +0 -17
- data/spec/unit/core/nil_logger_spec.rb +0 -13
- data/spec/unit/extensions/hash_spec.rb +0 -22
- data/spec/unit/godzilla/goodzilla_spec.rb +0 -74
- data/spec/unit/helpers/check_helper_production_spec.rb +0 -34
- data/spec/unit/helpers/check_helper_spec.rb +0 -134
- data/spec/unit/helpers/csv_helper_spec.rb +0 -22
- data/spec/unit/helpers/data_helper_spec.rb +0 -67
- data/spec/unit/helpers/global_helpers_spec.rb +0 -264
- data/spec/unit/helpers_spec.rb +0 -254
- data/spec/unit/lcm/lcm2_spec.rb +0 -100
- data/spec/unit/lcm/user_bricks_helper_spec.rb +0 -58
- data/spec/unit/models/blueprint/attribute_sort_by_spec.rb +0 -20
- data/spec/unit/models/blueprint/attributes_spec.rb +0 -28
- data/spec/unit/models/blueprint/dataset_spec.rb +0 -120
- data/spec/unit/models/blueprint/label_blueprint_field_spec.rb +0 -43
- data/spec/unit/models/blueprint/project_blueprint_spec.rb +0 -642
- data/spec/unit/models/blueprint/reference_spec.rb +0 -28
- data/spec/unit/models/blueprint/schema_builder_spec.rb +0 -36
- data/spec/unit/models/blueprint/to_wire_spec.rb +0 -196
- data/spec/unit/models/dataset_blueprint.rb +0 -14
- data/spec/unit/models/execution_spec.rb +0 -109
- data/spec/unit/models/from_wire_spec.rb +0 -321
- data/spec/unit/models/metadata_spec.rb +0 -140
- data/spec/unit/models/metric_spec.rb +0 -129
- data/spec/unit/models/model_spec.rb +0 -87
- data/spec/unit/models/project_creator_spec.rb +0 -90
- data/spec/unit/models/project_spec.rb +0 -94
- data/spec/unit/models/report_result_data_spec.rb +0 -194
- data/spec/unit/models/to_manifest_spec.rb +0 -165
- data/spec/unit/models/user_filters/user_filter_builder_spec.rb +0 -149
- data/spec/unit/models/user_filters_spec.rb +0 -95
- data/spec/unit/models/variable_spec.rb +0 -280
- data/spec/unit/rest/phmap_spec.rb +0 -117
- data/spec/unit/rest/polling_spec.rb +0 -101
- data/spec/unit/rest/resource_spec.rb +0 -10
- data/spec/vcr_configurer.rb +0 -63
@@ -1,91 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
require 'gooddata'
|
8
|
-
|
9
|
-
describe GoodData::Rest::Connection, :constraint => 'slow' do
|
10
|
-
it "should log in and disconnect" do
|
11
|
-
client = ConnectionHelper.create_default_connection
|
12
|
-
expect(client).to be_kind_of(GoodData::Rest::Client)
|
13
|
-
|
14
|
-
client.get("/gdc/md")
|
15
|
-
|
16
|
-
client.disconnect
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should be able to log in with user name and password as params' do
|
20
|
-
client = GoodData.connect(GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME, GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD,
|
21
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
22
|
-
verify_ssl: false)
|
23
|
-
client.disconnect
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'should be able to log in with user name and password as hash' do
|
27
|
-
client = GoodData.connect(username: GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME,
|
28
|
-
password: GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD,
|
29
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
30
|
-
verify_ssl: false)
|
31
|
-
client.disconnect
|
32
|
-
end
|
33
|
-
|
34
|
-
it 'should be able to log in with login and password as hash' do
|
35
|
-
client = GoodData.connect(login: GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME,
|
36
|
-
password: GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD,
|
37
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
38
|
-
verify_ssl: false)
|
39
|
-
client.disconnect
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'should be able to pass additional params in hash' do
|
43
|
-
client = GoodData.connect(login: GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME,
|
44
|
-
password: GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD,
|
45
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
46
|
-
webdav_server: 'https://some_random_server/',
|
47
|
-
verify_ssl: false)
|
48
|
-
expect(client.opts[:webdav_server]).to eq 'https://some_random_server/'
|
49
|
-
client.disconnect
|
50
|
-
end
|
51
|
-
|
52
|
-
it 'should be able to pass additional params in hash when used login/pass' do
|
53
|
-
client = GoodData.connect(GoodData::Environment::ConnectionHelper::DEFAULT_USERNAME, GoodData::Environment::ConnectionHelper::DEFAULT_PASSWORD,
|
54
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
55
|
-
webdav_server: 'https://some_random_server/',
|
56
|
-
verify_ssl: false)
|
57
|
-
expect(client.opts[:webdav_server]).to eq 'https://some_random_server/'
|
58
|
-
client.disconnect
|
59
|
-
end
|
60
|
-
|
61
|
-
it "should log in and disconnect with SST" do
|
62
|
-
regular_client = ConnectionHelper.create_default_connection
|
63
|
-
sst = regular_client.connection.sst_token
|
64
|
-
|
65
|
-
sst_client = GoodData.connect(sst_token: sst, verify_ssl: false)
|
66
|
-
expect(sst_client.projects.count).to be > 0
|
67
|
-
sst_client.disconnect
|
68
|
-
|
69
|
-
regular_client.disconnect
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should log in and disconnect with SST with additional params" do
|
73
|
-
regular_client = ConnectionHelper.create_default_connection
|
74
|
-
sst = regular_client.connection.sst_token
|
75
|
-
|
76
|
-
sst_client = GoodData.connect(sst_token: sst, verify_ssl: false, webdav_server: 'https://some_random_server/')
|
77
|
-
expect(sst_client.projects.count).to be > 0
|
78
|
-
expect(sst_client.opts[:webdav_server]).to eq 'https://some_random_server/'
|
79
|
-
sst_client.disconnect
|
80
|
-
|
81
|
-
regular_client.disconnect
|
82
|
-
end
|
83
|
-
|
84
|
-
it "should be able to regenerate TT" do
|
85
|
-
regular_client = ConnectionHelper.create_default_connection
|
86
|
-
regular_client.projects
|
87
|
-
regular_client.connection.headers.delete(:x_gdc_authtt)
|
88
|
-
regular_client.get('/gdc/md')
|
89
|
-
expect(regular_client.connection.headers).to have_key :x_gdc_authtt
|
90
|
-
end
|
91
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
#
|
7
|
-
ENV['RSPEC_ENV'] = 'test'
|
8
|
-
|
9
|
-
require 'simplecov'
|
10
|
-
# for simplecov to work correctly, it has to be started before any other code
|
11
|
-
SimpleCov.start do
|
12
|
-
add_filter 'spec/'
|
13
|
-
|
14
|
-
add_group 'Middleware', 'lib/gooddata/bricks/middleware'
|
15
|
-
add_group 'CLI', 'lib/gooddata/cli'
|
16
|
-
add_group 'Commands', 'lib/gooddata/commands'
|
17
|
-
add_group 'Core', 'lib/gooddata/core'
|
18
|
-
add_group 'Exceptions', 'lib/gooddata/exceptions'
|
19
|
-
add_group 'Extensions', 'lib/gooddata/extensions'
|
20
|
-
add_group 'Goodzilla', 'lib/gooddata/goodzilla'
|
21
|
-
add_group 'Models', 'lib/gooddata/models'
|
22
|
-
add_group 'LCM', 'lib/gooddata/lcm'
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'pmap'
|
26
|
-
require 'rspec'
|
27
|
-
require 'pathname'
|
28
|
-
require 'webmock/rspec'
|
29
|
-
require 'gooddata'
|
30
|
-
|
31
|
-
vcr_enabled = !ENV['VCR_ON'] || ENV['VCR_ON'] == 'true' # VCR is enabled by default - set VCR_ON=false to disable
|
32
|
-
require 'vcr_configurer' if vcr_enabled
|
33
|
-
|
34
|
-
logger = Logger.new(STDOUT)
|
35
|
-
logger.level = Logger::WARN
|
36
|
-
GoodData.logger = logger
|
37
|
-
|
38
|
-
# Automagically include all helpers/*_helper.rb
|
39
|
-
|
40
|
-
require_relative 'environment/environment'
|
41
|
-
|
42
|
-
GoodData::Environment.load
|
43
|
-
|
44
|
-
base = Pathname(__FILE__).dirname.expand_path
|
45
|
-
Dir.glob(base + 'helpers/*_helper.rb').each do |file|
|
46
|
-
require file
|
47
|
-
end
|
48
|
-
|
49
|
-
include GoodData::Helpers
|
50
|
-
|
51
|
-
RSpec::Expectations.configuration.warn_about_potential_false_positives = false
|
52
|
-
|
53
|
-
RSpec.configure do |config|
|
54
|
-
config.deprecation_stream = File.open('deprecations.txt', 'w')
|
55
|
-
|
56
|
-
config.include BlueprintHelper
|
57
|
-
config.include CliHelper
|
58
|
-
config.include ConnectionHelper
|
59
|
-
config.include CryptoHelper
|
60
|
-
config.include CsvHelper
|
61
|
-
config.include ProcessHelper
|
62
|
-
config.include ProjectHelper
|
63
|
-
config.include ScheduleHelper
|
64
|
-
# config.include SchemaHelper
|
65
|
-
|
66
|
-
config.filter_run_excluding :broken => true
|
67
|
-
|
68
|
-
config.fail_fast = false
|
69
|
-
|
70
|
-
if vcr_enabled
|
71
|
-
config.before(:all) do
|
72
|
-
# in case the test uses VCR
|
73
|
-
if self.class.metadata[:vcr]
|
74
|
-
# replace parallel iterations with the serial one, since VCR can't handle parallel request matching correctly
|
75
|
-
module Enumerable
|
76
|
-
def peach_with_index(*)
|
77
|
-
each_with_index
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
# insert the cassete recording everything what happens outside the tests cases
|
82
|
-
VCR.insert_cassette("#{self.class.metadata[:description]}/all")
|
83
|
-
|
84
|
-
# avoid polling idle time by overriding sleep
|
85
|
-
module Kernel
|
86
|
-
alias :old_sleep :sleep
|
87
|
-
def sleep(n)
|
88
|
-
n
|
89
|
-
end
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
config.after(:all) do
|
95
|
-
# in case the test uses VCR
|
96
|
-
if self.class.metadata[:vcr]
|
97
|
-
# eject the cassete recording everything what happens outside the tests cases
|
98
|
-
VCR.eject_cassette
|
99
|
-
|
100
|
-
# reload the original parallel iterations
|
101
|
-
load('pmap.rb') if self.class.metadata[:vcr]
|
102
|
-
|
103
|
-
# reload sleep method
|
104
|
-
module Kernel
|
105
|
-
alias :sleep :old_sleep
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
require 'gooddata/lcm/actions/associate_clients'
|
8
|
-
require 'gooddata/lcm/lcm2'
|
9
|
-
|
10
|
-
describe GoodData::LCM2::AssociateClients do
|
11
|
-
DATA_PRODUCT_ID = 'data-product-id'
|
12
|
-
|
13
|
-
let(:gdc_gd_client) { double(:gdc_gd_client) }
|
14
|
-
let(:segment) { double(:segment) }
|
15
|
-
let(:domain) { double(:domain) }
|
16
|
-
let(:client) { double(:client) }
|
17
|
-
let(:data_product) { double(:data_product) }
|
18
|
-
|
19
|
-
before do
|
20
|
-
allow(gdc_gd_client).to receive(:domain) { domain }
|
21
|
-
allow(domain).to receive(:update_clients_settings)
|
22
|
-
allow(domain).to receive(:segments) { segment }
|
23
|
-
allow(domain).to receive(:update_clients) {}
|
24
|
-
allow(segment).to receive(:clients) { [client] }
|
25
|
-
allow(client).to receive(:id) { 'an-id' }
|
26
|
-
allow(segment).to receive(:create_client) { client }
|
27
|
-
allow(segment).to receive(:data_product) { data_product }
|
28
|
-
allow(data_product).to receive(:data_product_id) { DATA_PRODUCT_ID }
|
29
|
-
end
|
30
|
-
|
31
|
-
context 'when clients parameter is passed' do
|
32
|
-
let(:params) do
|
33
|
-
params = {
|
34
|
-
gdc_gd_client: gdc_gd_client,
|
35
|
-
clients: [
|
36
|
-
{ segment: segment }
|
37
|
-
],
|
38
|
-
domain: domain
|
39
|
-
}
|
40
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
41
|
-
end
|
42
|
-
|
43
|
-
it 'enriches the clients with data_product_id' do
|
44
|
-
subject.class.call(params)
|
45
|
-
expect(params.clients.first.data_product_id).to eq(DATA_PRODUCT_ID)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
require 'gooddata/lcm/lcm2'
|
8
|
-
require 'gooddata/lcm/actions/collect_client_projects'
|
9
|
-
|
10
|
-
describe GoodData::LCM2::CollectClientProjects do
|
11
|
-
let(:gdc_gd_client) { double('gdc_gd_client') }
|
12
|
-
let(:domain) { double('domain') }
|
13
|
-
let(:segment) { double('segment') }
|
14
|
-
let(:client) { double('client') }
|
15
|
-
let(:project) { double('project') }
|
16
|
-
|
17
|
-
context 'some clients are existing in segment' do
|
18
|
-
let(:params) do
|
19
|
-
params = {
|
20
|
-
gdc_gd_client: gdc_gd_client,
|
21
|
-
organization: domain,
|
22
|
-
segments: [
|
23
|
-
{
|
24
|
-
segment_id: 'id'
|
25
|
-
}
|
26
|
-
]
|
27
|
-
}
|
28
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
29
|
-
end
|
30
|
-
|
31
|
-
before do
|
32
|
-
allow(gdc_gd_client).to receive(:domain) { domain }
|
33
|
-
allow(domain).to receive(:segments) { [segment] }
|
34
|
-
allow(segment).to receive(:segment_id) { 'id' }
|
35
|
-
allow(segment).to receive(:clients) { [client] }
|
36
|
-
allow(client).to receive(:project) { project }
|
37
|
-
allow(client).to receive(:client_id) { 'client_id' }
|
38
|
-
allow(project).to receive(:pid) { '123456789' }
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'collect their projects' do
|
42
|
-
result = subject.class.call(params)
|
43
|
-
expect(result[:params][:client_projects]).to eq('client_id' => { segment_client: client, project: project })
|
44
|
-
expect(result[:results]).to eq [{ client_id: 'client_id', project: '123456789' }]
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
require 'gooddata/lcm/actions/collect_clients'
|
8
|
-
require 'gooddata/lcm/lcm2'
|
9
|
-
|
10
|
-
describe GoodData::LCM2::CollectClients do
|
11
|
-
let(:data_source) { double(:data_source) }
|
12
|
-
let(:input_data) { double(:input_data) }
|
13
|
-
let(:gdc_gd_client) { double(:gdc_gd_client) }
|
14
|
-
let(:datasource) { double(:datasource) }
|
15
|
-
let(:project) { double(:project) }
|
16
|
-
|
17
|
-
before do
|
18
|
-
allow(project).to receive(:deleted?).and_return(false)
|
19
|
-
allow(gdc_gd_client).to receive(:projects).and_return(project)
|
20
|
-
allow(GoodData::Helpers::DataSource).to receive(:new)
|
21
|
-
.and_return(data_source)
|
22
|
-
allow(data_source).to receive(:realize)
|
23
|
-
.and_return('spec/data/workspace_table.csv')
|
24
|
-
end
|
25
|
-
|
26
|
-
context 'when segments is specified' do
|
27
|
-
let(:params) do
|
28
|
-
params = {
|
29
|
-
gdc_gd_client: gdc_gd_client,
|
30
|
-
segments: [{ segment_id: 'segment_foo' }],
|
31
|
-
input_source: {}
|
32
|
-
}
|
33
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
34
|
-
end
|
35
|
-
|
36
|
-
it 'collects all clients' do
|
37
|
-
result = subject.class.call(params)
|
38
|
-
expected = [{ client: 'client_foo',
|
39
|
-
segment_id: 'segment_foo',
|
40
|
-
title: nil }]
|
41
|
-
expect(result[:results]).to eq(expected)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'when input source contains deleted project' do
|
46
|
-
let(:params) do
|
47
|
-
params = {
|
48
|
-
gdc_gd_client: gdc_gd_client,
|
49
|
-
segments: [{ segment_id: 'segment_foo' }],
|
50
|
-
input_source: {}
|
51
|
-
}
|
52
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
53
|
-
end
|
54
|
-
|
55
|
-
before do
|
56
|
-
allow(project).to receive(:deleted?).and_return(true)
|
57
|
-
end
|
58
|
-
|
59
|
-
it 'raise error' do
|
60
|
-
expect do
|
61
|
-
subject.class.call(params)
|
62
|
-
end.to raise_error(/Project 123456 of client client_foo is deleted./)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
describe GoodData::LCM2::CollectDataProduct do
|
8
|
-
it 'Has GoodData::Bricks::DefaultDataProductMiddleware class' do
|
9
|
-
GoodData::LCM2::CollectDataProduct.should_not be(nil)
|
10
|
-
end
|
11
|
-
|
12
|
-
let(:client) { double(:client) }
|
13
|
-
let(:domain) { double(:domain) }
|
14
|
-
let(:gdc_logger) { double(:gdc_logger) }
|
15
|
-
let(:data_product) { GoodData::DataProduct.new({}) }
|
16
|
-
|
17
|
-
before do
|
18
|
-
allow(client).to receive(:domain) { domain }
|
19
|
-
allow(gdc_logger).to receive(:info)
|
20
|
-
allow(domain).to receive(:data_products) { data_product }
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'when data_product parameter is passed' do
|
24
|
-
let(:data_product_id) { 'data-product' }
|
25
|
-
let(:params) do
|
26
|
-
params = {
|
27
|
-
domain: domain,
|
28
|
-
gdc_gd_client: client,
|
29
|
-
gdc_logger: gdc_logger,
|
30
|
-
data_product: data_product_id
|
31
|
-
}
|
32
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
33
|
-
end
|
34
|
-
|
35
|
-
it 'collects the specified data_product object' do
|
36
|
-
expect(domain).to receive(:data_products).with(data_product_id)
|
37
|
-
result = subject.class.call(params)
|
38
|
-
expect(result[:params][:data_product]).to be_a GoodData::DataProduct
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context 'when no data_product parameter is passed' do
|
43
|
-
let(:params) do
|
44
|
-
params = {
|
45
|
-
gdc_gd_client: client,
|
46
|
-
gdc_logger: gdc_logger,
|
47
|
-
domain: domain
|
48
|
-
}
|
49
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "collects the 'default' data_product" do
|
53
|
-
expect(domain).to receive(:data_products).with('default')
|
54
|
-
result = subject.class.call(params)
|
55
|
-
expect(result[:params][:data_product]).to be_a GoodData::DataProduct
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
#
|
3
|
-
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
|
4
|
-
# This source code is licensed under the BSD-style license found in the
|
5
|
-
# LICENSE file in the root directory of this source tree.
|
6
|
-
|
7
|
-
require 'gooddata/lcm/actions/collect_dynamic_schedule_params'
|
8
|
-
require 'gooddata/lcm/lcm2'
|
9
|
-
|
10
|
-
describe GoodData::LCM2::CollectDymanicScheduleParams do
|
11
|
-
let(:data_source) { double(:data_source) }
|
12
|
-
|
13
|
-
before do
|
14
|
-
allow(GoodData::Helpers::DataSource).to receive(:new).and_return(data_source)
|
15
|
-
allow(data_source).to receive(:realize).and_return('spec/data/dynamic_schedule_params_table.csv')
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'when dynamic schedule params are passed' do
|
19
|
-
let(:params) do
|
20
|
-
params = {
|
21
|
-
dynamic_params: {
|
22
|
-
input_source: {}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
GoodData::LCM2.convert_to_smart_hash(params)
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'collects them' do
|
29
|
-
result = subject.class.call(params)
|
30
|
-
expected = {
|
31
|
-
'client_1' => {
|
32
|
-
'rollout' => {
|
33
|
-
'MODE' => 'mode_a'
|
34
|
-
},
|
35
|
-
all_schedules: {
|
36
|
-
'MODE' => 'mode_x'
|
37
|
-
},
|
38
|
-
'release' => {
|
39
|
-
'MODE' => 'mode_c'
|
40
|
-
}
|
41
|
-
},
|
42
|
-
'client_2' => {
|
43
|
-
'provisioning' => {
|
44
|
-
'MODE' => 'mode_b'
|
45
|
-
}
|
46
|
-
},
|
47
|
-
all_clients: {
|
48
|
-
all_schedules: {
|
49
|
-
'MODE' => 'mode_all'
|
50
|
-
}
|
51
|
-
}
|
52
|
-
}
|
53
|
-
expect(result[:params][:schedule_params]).to eq(expected)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|