gooddata 1.1.0-java → 1.2.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.document +0 -0
- data/.flayignore +2 -0
- data/.travis.yml +24 -7
- data/.yardopts +0 -0
- data/CHANGELOG.md +144 -0
- 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 +23 -452
- 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,37 +0,0 @@
|
|
|
1
|
-
# encoding: UTF-8
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2010-2018 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_relative '../helpers/connection_helper'
|
|
8
|
-
|
|
9
|
-
describe GoodData do
|
|
10
|
-
let(:login) { 'rubydev+admin@gooddata.com' }
|
|
11
|
-
KEYS = ['dev-gooddata-sso.pub', 'rubydev_public.gpg', 'rubydev_secret_keys.gpg']
|
|
12
|
-
|
|
13
|
-
before do
|
|
14
|
-
cipher = ENV['GD_SPEC_PASSWORD'] || ENV['BIA_ENCRYPTION_KEY']
|
|
15
|
-
KEYS.each do |key|
|
|
16
|
-
File.write(key, GoodData::Helpers.decrypt(File.read(key + '.encrypted'), cipher))
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
`gpg --import #{KEYS.join(' ')}`
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it 'can use SSO' do
|
|
23
|
-
rest_client = GoodData.connect_sso(
|
|
24
|
-
login,
|
|
25
|
-
'test-ruby',
|
|
26
|
-
GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
|
27
|
-
server: GoodData::Environment::ConnectionHelper::DEFAULT_SERVER,
|
|
28
|
-
verify_ssl: false
|
|
29
|
-
)
|
|
30
|
-
user = rest_client.domain(GoodData::Environment::ConnectionHelper::DEFAULT_DOMAIN).users(login, client: rest_client)
|
|
31
|
-
expect(user).to be_truthy
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
after do
|
|
35
|
-
KEYS.each { |key| File.delete(key) }
|
|
36
|
-
end
|
|
37
|
-
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/connection'
|
|
8
|
-
|
|
9
|
-
describe GoodData::Rest::Connection, :vcr do
|
|
10
|
-
before(:all) do
|
|
11
|
-
USERNAME = ConnectionHelper::DEFAULT_USERNAME
|
|
12
|
-
PASSWORD = ConnectionHelper::DEFAULT_PASSWORD
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it "Has DEFAULT_URL defined" do
|
|
16
|
-
GoodData::Rest::Connection::DEFAULT_URL.should be_a(String)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
it "Has LOGIN_PATH defined" do
|
|
20
|
-
GoodData::Rest::Connection::LOGIN_PATH.should be_a(String)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "Has TOKEN_PATH defined" do
|
|
24
|
-
GoodData::Rest::Connection::TOKEN_PATH.should be_a(String)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
describe '#connect' do
|
|
28
|
-
it "Connects using username and password" do
|
|
29
|
-
c = GoodData.connect(ConnectionHelper::DEFAULT_USERNAME, ConnectionHelper::DEFAULT_PASSWORD, :verify_ssl => 0)
|
|
30
|
-
c.should be_a(GoodData::Rest::Client)
|
|
31
|
-
c.disconnect
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
describe '#disconnect' do
|
|
36
|
-
it "Connects using username and password" do
|
|
37
|
-
c = GoodData.connect(ConnectionHelper::DEFAULT_USERNAME, ConnectionHelper::DEFAULT_PASSWORD, :verify_ssl => 0)
|
|
38
|
-
c.disconnect
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
describe '#generate_request_id' do
|
|
43
|
-
it "Generates a non-empty string" do
|
|
44
|
-
c = ConnectionHelper.create_default_connection
|
|
45
|
-
|
|
46
|
-
# generate a request id, and pass it to a request
|
|
47
|
-
id = c.generate_request_id
|
|
48
|
-
c.get('/gdc/md', :request_id => id)
|
|
49
|
-
|
|
50
|
-
id.should be_a(String)
|
|
51
|
-
id.should_not be_empty
|
|
52
|
-
|
|
53
|
-
c.disconnect
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
@@ -1,132 +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/core/logging'
|
|
8
|
-
require 'logger'
|
|
9
|
-
|
|
10
|
-
# Logger that remembers the last logged message
|
|
11
|
-
class TestLogger < Logger
|
|
12
|
-
attr_reader :last_message
|
|
13
|
-
def debug(*args)
|
|
14
|
-
@last_message = args[0] if level == Logger::DEBUG
|
|
15
|
-
super(*args)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def info(*args)
|
|
19
|
-
@last_message = args[0] if level <= Logger::INFO
|
|
20
|
-
super(*args)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
def warn(*args)
|
|
24
|
-
@last_message = args[0] if level <= Logger::WARN
|
|
25
|
-
super(*args)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def error(*args)
|
|
29
|
-
@last_message = args[0] if level <= Logger::ERROR
|
|
30
|
-
super(*args)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def fatal(*args)
|
|
34
|
-
@last_message = args[0] if level <= Logger::FATAL
|
|
35
|
-
super(*args)
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
describe 'GoodData - logging', :vcr do
|
|
40
|
-
TEST_MESSAGE = 'Hello World!'
|
|
41
|
-
|
|
42
|
-
def test_error
|
|
43
|
-
GoodData.logger.error TEST_MESSAGE
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def test_info
|
|
47
|
-
GoodData.logger.info TEST_MESSAGE
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def test_warn
|
|
51
|
-
GoodData.logger.warn TEST_MESSAGE
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
def test_request_id_logging
|
|
55
|
-
@client = ConnectionHelper.create_default_connection
|
|
56
|
-
id = @client.generate_request_id
|
|
57
|
-
GoodData.logger.info "Request id: #{id} Doing something very useful"
|
|
58
|
-
@client.get('/gdc/md', :request_id => id)
|
|
59
|
-
id
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def test_all
|
|
63
|
-
test_error
|
|
64
|
-
test_info
|
|
65
|
-
test_warn
|
|
66
|
-
test_request_id_logging
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
before(:each) do
|
|
70
|
-
# remember the state of logging before
|
|
71
|
-
@logging_on_at_start = GoodData.logging_on?
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
after(:each) do
|
|
75
|
-
# restore the logging state
|
|
76
|
-
if @logging_on_at_start
|
|
77
|
-
GoodData.logging_on
|
|
78
|
-
else
|
|
79
|
-
GoodData.logging_off
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
@client.disconnect if @client
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
describe '#logger' do
|
|
86
|
-
it "can assign a custom logger" do
|
|
87
|
-
GoodData.logger = TestLogger.new(STDOUT)
|
|
88
|
-
test_all
|
|
89
|
-
end
|
|
90
|
-
it 'has the request id logged when I passed it' do
|
|
91
|
-
GoodData.logger = TestLogger.new(STDOUT)
|
|
92
|
-
id = test_request_id_logging
|
|
93
|
-
expect(GoodData.logger.last_message).to include(id)
|
|
94
|
-
end
|
|
95
|
-
it 'client logs when given custom message' do
|
|
96
|
-
GoodData.logger = TestLogger.new(STDOUT)
|
|
97
|
-
GoodData.logger.level = Logger::INFO
|
|
98
|
-
@client = ConnectionHelper.create_default_connection
|
|
99
|
-
message = "Getting all projects."
|
|
100
|
-
@client.get('/gdc/md', :info_message => message)
|
|
101
|
-
expect(GoodData.logger.last_message).to include(message)
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
describe '#logging_on' do
|
|
106
|
-
it 'Enables logging' do
|
|
107
|
-
GoodData.logging_on
|
|
108
|
-
test_all
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
describe '#logging_off' do
|
|
113
|
-
it 'Disables logging' do
|
|
114
|
-
GoodData.logging_off
|
|
115
|
-
test_all
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
describe '#logger' do
|
|
120
|
-
it '#error works' do
|
|
121
|
-
test_error
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
it '#info works' do
|
|
125
|
-
test_info
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
it '#warn works' do
|
|
129
|
-
test_warn
|
|
130
|
-
end
|
|
131
|
-
end
|
|
132
|
-
end
|
|
@@ -1,54 +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/connection'
|
|
8
|
-
require 'gooddata/core/project'
|
|
9
|
-
require 'gooddata/models/project'
|
|
10
|
-
|
|
11
|
-
describe 'GoodData - project', :vcr do
|
|
12
|
-
before(:each) do
|
|
13
|
-
@client = ConnectionHelper.create_default_connection
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
after(:each) do
|
|
17
|
-
@client.disconnect
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
describe '#project=' do
|
|
21
|
-
it 'Assigns nil' do
|
|
22
|
-
GoodData.project = nil
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it 'Assigns project using project ID' do
|
|
26
|
-
GoodData.use(ProjectHelper::PROJECT_ID, client: @client)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it 'Assigns project using project URL' do
|
|
30
|
-
GoodData.use ProjectHelper::PROJECT_URL, client: @client
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it 'Assigns project directly' do
|
|
34
|
-
GoodData.project = GoodData::Project[ProjectHelper::PROJECT_ID, client: @client]
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
describe '#project' do
|
|
39
|
-
it 'Returns project assigned' do
|
|
40
|
-
GoodData.project = nil
|
|
41
|
-
expect(GoodData.project).to be_nil
|
|
42
|
-
|
|
43
|
-
GoodData.use ProjectHelper::PROJECT_ID, client: @client
|
|
44
|
-
expect(GoodData.project).not_to be_nil
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
describe '#with_project' do
|
|
49
|
-
it 'Uses project specified' do
|
|
50
|
-
GoodData.with_project GoodData::Project[ProjectHelper::PROJECT_ID, :client => @client] do
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|
|
@@ -1,29 +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 'Spin a project from template', :constraint => 'slow' do
|
|
10
|
-
before(:all) do
|
|
11
|
-
@client = ConnectionHelper.create_default_connection
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
after(:all) do
|
|
15
|
-
@client.disconnect
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'should spin a project from a template that does not exist. It should throw an error' do
|
|
19
|
-
expect do
|
|
20
|
-
GoodData::Project.create(
|
|
21
|
-
title: 'Test project',
|
|
22
|
-
template: '/some/nonexisting/template/uri',
|
|
23
|
-
auth_token: ConnectionHelper::GD_PROJECT_TOKEN,
|
|
24
|
-
environment: ProjectHelper::ENVIRONMENT,
|
|
25
|
-
client: @client
|
|
26
|
-
)
|
|
27
|
-
end.to raise_error
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,27 +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 'Create project using GoodData client', :constraint => 'slow' do
|
|
10
|
-
before(:all) do
|
|
11
|
-
@client = ConnectionHelper.create_default_connection
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
after(:all) do
|
|
15
|
-
@client.disconnect
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
it 'Should create project using GoodData::Rest::Client#create_project' do
|
|
19
|
-
project_title = 'Test #create_project'
|
|
20
|
-
begin
|
|
21
|
-
project = @client.create_project(:title => project_title, :auth_token => ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
|
|
22
|
-
expect(project.title).to eq(project_title)
|
|
23
|
-
ensure
|
|
24
|
-
project.delete if project
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,154 +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 "Swapping a date dimension and exchanging all attributes/elements", :constraint => 'slow' do
|
|
10
|
-
before(:all) do
|
|
11
|
-
@client = ConnectionHelper.create_default_connection
|
|
12
|
-
@blueprint = GoodData::Model::ProjectBlueprint.build("My project from blueprint") do |p|
|
|
13
|
-
p.add_date_dimension('created_on')
|
|
14
|
-
p.add_date_dimension('created_on_2')
|
|
15
|
-
|
|
16
|
-
p.add_dataset('dataset.users') do |d|
|
|
17
|
-
d.add_anchor('attr.users.id')
|
|
18
|
-
d.add_label('label.users.id', reference: 'attr.users.id')
|
|
19
|
-
d.add_date('created_on')
|
|
20
|
-
d.add_fact('fact.users.some_number')
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Create a project
|
|
25
|
-
@project = @client.create_project_from_blueprint(@blueprint, token: ConnectionHelper::GD_PROJECT_TOKEN, environment: ProjectHelper::ENVIRONMENT)
|
|
26
|
-
|
|
27
|
-
# Load data
|
|
28
|
-
users_data = [
|
|
29
|
-
["label.users.id", "created_on", "fact.users.some_number"],
|
|
30
|
-
[1, "01/01/2014", 1],
|
|
31
|
-
[2, "10/15/2014", 2],
|
|
32
|
-
[3, "05/02/2014", 3]
|
|
33
|
-
]
|
|
34
|
-
@project.upload(users_data, @blueprint, 'dataset.users')
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
after(:all) do
|
|
38
|
-
@project.delete unless @project.nil?
|
|
39
|
-
|
|
40
|
-
@client.disconnect
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it 'should not get error when execute report with timestamp' do
|
|
44
|
-
metric = @project.attributes('created_on.date').create_metric(title: 'test_metric')
|
|
45
|
-
metric.save
|
|
46
|
-
|
|
47
|
-
report = @project.create_report(
|
|
48
|
-
left: metric,
|
|
49
|
-
top: ['created_on.quarter'],
|
|
50
|
-
filters: [['created_on.year', 2015, 2016]],
|
|
51
|
-
title: 'test_report'
|
|
52
|
-
)
|
|
53
|
-
report.execute(time: Time.now)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it "should swap the dimension, exchange all stuffs and not break anything" do
|
|
57
|
-
# WE have 2 date dims
|
|
58
|
-
expect(@blueprint.date_dimensions.map(&:id)).to eq %w(created_on created_on_2)
|
|
59
|
-
# One is connected
|
|
60
|
-
expect(@blueprint.datasets.flat_map(&:references).map(&:reference).include?('created_on')).to be_truthy
|
|
61
|
-
# The other is disconnected
|
|
62
|
-
expect(@blueprint.datasets.flat_map(&:references).map(&:reference).include?('created_on_2')).to be_falsey
|
|
63
|
-
|
|
64
|
-
# Create a metric
|
|
65
|
-
@metric_1 = @project.attributes('created_on.date').create_metric(title: 'Count of days in DD')
|
|
66
|
-
@metric_1.save
|
|
67
|
-
|
|
68
|
-
# Create a report
|
|
69
|
-
@report = @project.create_report(left: @metric_1, top: ['created_on.date'], title: 'Beautiful report')
|
|
70
|
-
@report.save
|
|
71
|
-
|
|
72
|
-
def suggest_mapping(label_a, label_b, project)
|
|
73
|
-
as = project.attributes
|
|
74
|
-
a1 = as.select { |a| a.identifier.include?("#{label_a}.") }.pmapcat { |a| [a] + a.labels }
|
|
75
|
-
a2 = as.select { |a| a.identifier.include?("#{label_b}.") }.pmapcat { |a| [a] + a.labels }
|
|
76
|
-
a1.reduce({}) do |a, e|
|
|
77
|
-
match = a2.find { |l| l.identifier.gsub(/^#{label_b}/, '') == e.identifier.gsub(/^#{label_a}/, '') }
|
|
78
|
-
a[e.identifier] = match && match.identifier
|
|
79
|
-
a
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
# Create definition with report specific metric
|
|
84
|
-
@metric_2 = @project.attributes('created_on.date').create_metric(title: 'Count of days in DD Secret')
|
|
85
|
-
@metric_2.deprecated = true
|
|
86
|
-
@metric_2.save
|
|
87
|
-
@report_with_private = @project.create_report(
|
|
88
|
-
left: @metric_2,
|
|
89
|
-
top: ['created_on.day.in.week'],
|
|
90
|
-
title: 'Beautiful report with private'
|
|
91
|
-
)
|
|
92
|
-
@report_with_private.save
|
|
93
|
-
|
|
94
|
-
# Create a definition with a filter value
|
|
95
|
-
@report = @project.create_report(
|
|
96
|
-
left: @metric_2,
|
|
97
|
-
top: ['created_on.quarter'],
|
|
98
|
-
filters: [['created_on.year', 2015, 2016]],
|
|
99
|
-
title: 'Beautiful report with filters'
|
|
100
|
-
)
|
|
101
|
-
@report.save
|
|
102
|
-
|
|
103
|
-
@label = @project.labels('created_on.year').primary_label
|
|
104
|
-
@variable = @project.create_variable(title: 'uaaa', attribute: @label.attribute).save
|
|
105
|
-
filters = [[ConnectionHelper::DEFAULT_USERNAME, @label.uri, '2015', '2016']]
|
|
106
|
-
@project.add_variable_permissions(filters, @variable)
|
|
107
|
-
|
|
108
|
-
as = @project.attributes.select { |a| a.identifier.include?('created_on_2.') }
|
|
109
|
-
expect(as.pmapcat { |a| a.usedby('report') }).to be_empty
|
|
110
|
-
expect(as.pmapcat { |a| a.usedby('metric') }).to be_empty
|
|
111
|
-
expect(as.pmapcat { |a| a.usedby('dashboard') }).to be_empty
|
|
112
|
-
|
|
113
|
-
year_obj_id = @project.attributes
|
|
114
|
-
.find { |a| a.identifier == 'created_on_2.year' }
|
|
115
|
-
.obj_id
|
|
116
|
-
|
|
117
|
-
# replace values
|
|
118
|
-
mapping = GoodData::Helpers.prepare_mapping(suggest_mapping('created_on', 'created_on_2', @project), project: @project)
|
|
119
|
-
@project.replace_from_mapping(mapping)
|
|
120
|
-
|
|
121
|
-
# Check if any of the attributes is used by any of the objects. All should be empty
|
|
122
|
-
as = @project.attributes.select { |a| a.identifier.include?('created_on.') }
|
|
123
|
-
expect(as.pmapcat { |a| a.usedby('report') }).to be_empty
|
|
124
|
-
expect(as.pmapcat { |a| a.usedby('metric') }).to be_empty
|
|
125
|
-
expect(as.pmapcat { |a| a.usedby('dashboard') }).to be_empty
|
|
126
|
-
|
|
127
|
-
# Reload stuff
|
|
128
|
-
@metric_2.reload!
|
|
129
|
-
@report.reload!
|
|
130
|
-
@report_with_private.reload!
|
|
131
|
-
|
|
132
|
-
# Stuff should be still computable
|
|
133
|
-
@metric_2.execute
|
|
134
|
-
@report.execute
|
|
135
|
-
@report_with_private.execute
|
|
136
|
-
|
|
137
|
-
# Labels
|
|
138
|
-
GoodData::SmallGoodZilla.get_uris(@metric_2.expression)
|
|
139
|
-
expect(@report.definition.attributes.map(&:identifier)).to eq ["created_on_2.quarter"]
|
|
140
|
-
|
|
141
|
-
ids = GoodData::SmallGoodZilla.get_uris(@report.definition.filters.first).map { |x| x.split('/')[-2..-1].join('/') }
|
|
142
|
-
expect(ids).to eq ["obj/#{year_obj_id}", "#{year_obj_id}/elements?id=2015", "#{year_obj_id}/elements?id=2016"]
|
|
143
|
-
|
|
144
|
-
ids = GoodData::SmallGoodZilla.get_uris(@variable.values.first.expression).map { |v| v.split('/')[-2..-1].join('/') }
|
|
145
|
-
expect(ids).to eq ["obj/#{year_obj_id}", "#{year_obj_id}/elements?id=2015", "#{year_obj_id}/elements?id=2016"]
|
|
146
|
-
|
|
147
|
-
# Swap the dims
|
|
148
|
-
bp = @project.blueprint
|
|
149
|
-
bp.swap_date_dimension!('created_on', 'created_on_2')
|
|
150
|
-
@project.update_from_blueprint(bp)
|
|
151
|
-
expect(bp.datasets.flat_map(&:references).map(&:reference).include?('created_on')).to be_falsey
|
|
152
|
-
expect(bp.datasets.flat_map(&:references).map(&:reference).include?('created_on_2')).to be_truthy
|
|
153
|
-
end
|
|
154
|
-
end
|