leap_salesforce 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08942c56565447b0c7fa381bb9b853f1553b17683b53cf801be10ee777d6e4e0'
4
- data.tar.gz: 3f6ef92d1f1d198f4512dd452bed489246e598a3a838eb4dec503098d96ee61b
3
+ metadata.gz: abbfab4a385a6d834dfcaf784c14d232669e85e0e2f7f9aaa8a4fdc99398b288
4
+ data.tar.gz: 4292651ae00e51421a0dc4260cd44e7f77539e8753431008c8fd30e7acd1f5ef
5
5
  SHA512:
6
- metadata.gz: 2e28c9f6dda53de160fe0eab240a174ce92043662d089cfd329de54d0fc3a4fcc70c25edafa5ec2a5aeea1b2b25986b1df67c24dbff3189bfb7fed321905dfbe
7
- data.tar.gz: b57058beb487934fbc70ce50d9ac1467c0970d0fc14f82e9cb328e7cc3c0ba807599c58f8cdf75e2e269c6679c44c058d4e54e4da386319765e2b374833bb4e3
6
+ metadata.gz: 8937117f55d69b733902bb49ded422a5602cb6040da7f987f2de5d36dbdfbab597fef81db1b256cf036cf7dea0ee3452fa7ccbbd10482c57b2f0104500785812
7
+ data.tar.gz: 12aa02241dbe430e5b048a0ca6c1bf683cb2fb279592a2adcc6203fe5861dc3ff8029b2573c76c035ec6168f093ead8e3bd0f10a53788399fadcead161302d6d
data/.gitlab-ci.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  include:
2
2
  - template: Code-Quality.gitlab-ci.yml
3
3
 
4
- image: ruby:2.7
4
+ image: ruby:3.0
5
5
 
6
6
  stages:
7
7
  - test
@@ -18,7 +18,7 @@ variables:
18
18
  pages:
19
19
  stage: deploy
20
20
  dependencies:
21
- - test_2.7
21
+ - test
22
22
  script:
23
23
  - mv coverage/ public
24
24
  artifacts:
@@ -612,7 +612,8 @@ pages:
612
612
  sfdx force:auth:jwt:grant --clientid "$SF_CONSUMER_KEY" --jwtkeyfile assets/server.key --username "$SF_USERNAME" --setdefaultdevhubusername --setalias HubOrg
613
613
  }
614
614
 
615
- test_2.7:
615
+ test:
616
+ image: ruby:3.0
616
617
  script:
617
618
  # Decrypt server key
618
619
  - *sfdx_helpers
@@ -624,14 +625,3 @@ test_2.7:
624
625
  artifacts:
625
626
  paths:
626
627
  - coverage/
627
-
628
- test_3.0:
629
- image: ruby:3.0
630
- script:
631
- # Decrypt server key
632
- - *sfdx_helpers
633
- - setup_integration_env
634
- - bundle exec rake check_oauth # Check OAuth
635
- - bundle exec rake leaps:create_soql_objects
636
- - bundle exec rake leaps:create_enums
637
- - bundle exec rspec
data/ChangeLog CHANGED
@@ -1,3 +1,18 @@
1
+ Version 1.1.0
2
+ * Proper fix to work with activerecord 7 - requires ruby > 2.7
3
+
4
+ Version 1.0.5
5
+ * Fix
6
+ * Stabilize using of active record by fixing version
7
+
8
+ Version 1.0.4
9
+ * Enhancement
10
+ * Strip out ':' from user key for when it is accidentally added
11
+
12
+ Version 1.0.3
13
+ * Enhancement
14
+ * Allow templates to be sourced from external gems for generator
15
+
1
16
  Version 1.0.2
2
17
  * Enhancement
3
18
  * Only load sub folders of leap_salesforce.lib_folder that are needed by this gem, allowing room for UI
data/README.md CHANGED
@@ -27,7 +27,7 @@ The benefits of an open source tool like this are:
27
27
  and can add extra unit tests if you need more confidence
28
28
  * Built with and for CI in Gitlab. Designed to work within Docker containers
29
29
  * Will integrate with `sfdx` leveraging all of it's benefits
30
- * Supported by [IntegrationQA](www.integrationqa.com) who can provide
30
+ * Supported by [Sentify](https://www.sentify.co/) who can provide
31
31
  [support and training](https://gitlab.com/leap-dojo/leap_salesforce/wikis/SupportModel)
32
32
  to help you get started and overcome challenges
33
33
 
@@ -260,7 +260,19 @@ The value of request body can be interrogated with `entity.request_parameters.bo
260
260
 
261
261
  ##### Logging
262
262
 
263
- By default, API traffic will be logged in a log file in a `logs` folder.
263
+ By default, API traffic will be logged in a log file in a `logs` folder. The gem `soaspec` is
264
+ used to log this traffic.
265
+
266
+ Following is an example of changing some of the default logging.
267
+
268
+ ```ruby
269
+ # Turn this true if you need debug authentication
270
+ Soaspec::OAuth2.debug_oauth = true
271
+ # Turn this to true if you want to see API traffic on the terminal
272
+ Soaspec::SpecLogger.output_to_terminal = true
273
+ ```
274
+
275
+ See more configuration parameters in the [Soaspec repo](https://gitlab.com/samuel-garratt/soaspec#logging)
264
276
 
265
277
  ### CRUD of data
266
278
 
@@ -565,4 +577,5 @@ Everyone interacting in the LeapSalesforce project’s codebases, issue trackers
565
577
  * Presentation on this library [here](https://gitpitch.com/leap-dojo/leap_salesforce?grs=gitlab)
566
578
  * Example of this library within a CI/CD pipeline [here](https://gitlab.com/iqa_public/labs/salesforce_cicd_demo)
567
579
  * Using `leap_salesforce` to download event log files [here](https://gitlab.com/samuel-garratt/leap_salesforce_event_log_files)
580
+ * Video walking through setting up automation using this [here](https://youtu.be/Xvj0mAnDKfA)
568
581
 
@@ -32,7 +32,7 @@ It reads the Metadata from Salesforce and creates the foundation for API tests.'
32
32
  spec.add_development_dependency 'semaphore_test_boosters'
33
33
  spec.add_development_dependency 'topoisomerase'
34
34
  spec.add_development_dependency 'yard-doctest'
35
- spec.add_dependency 'activerecord'
35
+ spec.add_dependency 'activerecord', '7'
36
36
  spec.add_dependency 'colorize'
37
37
  spec.add_dependency 'factory_bot'
38
38
  spec.add_dependency 'faker', '>= 2.0'
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'nori/core_ext'
4
4
  require 'humanize'
5
+ require 'active_support/isolated_execution_state'
5
6
  require 'active_support/core_ext/string'
6
7
  require 'date'
7
8
  require 'json'
@@ -50,7 +50,7 @@ module LeapSalesforce
50
50
  ' leap_salesforce testing repo'.colorize(:green)
51
51
  verify_environment
52
52
  verify_oauth
53
- @user_key = options[:user_key] || input_for('Enter a key to refer to this user (This will be stored as a Symbol)')
53
+ @user_key = options[:user_key] || input_for('Enter a key to refer to this user (This will be stored as a Symbol)').delete(':')
54
54
  end
55
55
  end
56
56
  end
@@ -8,11 +8,20 @@ require 'colorize'
8
8
  module LeapSalesforce
9
9
  # Generators for creating code
10
10
  module Generator
11
+ # @param [String] filename Relative filename to this file
12
+ # @param [String] folder Folder where templates are stored (for external gems)
13
+ # @return [String] Location of template file
14
+ def template_loc(filename, folder: nil)
15
+ template_dir = folder || __dir__
16
+ File.join(template_dir, 'templates', filename)
17
+ end
18
+
11
19
  # @param [String] filename Relative filename to this file
12
20
  # @param [Binding] binding Binding object used for ERB variables
21
+ # @param [String] folder Folder where templates are stored (for external gems)
13
22
  # @return [String] Interpreted file after calculating ERB for template file passed
14
- def read_template(filename, binding)
15
- ERB.new(File.read(File.join(__dir__, 'templates', filename))).result(binding)
23
+ def read_template(filename, binding, folder: nil)
24
+ ERB.new(File.read(template_loc(filename, folder: folder))).result(binding)
16
25
  end
17
26
 
18
27
  # Generate file creating necessary folder if necessary
@@ -70,7 +70,7 @@ module LeapSalesforce
70
70
 
71
71
  # Clean up files generated for all picklists
72
72
  def cleanup_files_created
73
- `rubocop -a #{ENUM_FOLDER} --display-only-fail-level-offenses --enable-pending-cops`
73
+ `rubocop -A #{ENUM_FOLDER} --display-only-fail-level-offenses --enable-pending-cops`
74
74
  end
75
75
  end
76
76
  end
@@ -62,8 +62,8 @@ module LeapSalesforce
62
62
  generate_field_module
63
63
  generate_factory
64
64
  end
65
- `rubocop -a #{SOQL_OBJECT_FOLDER} --enable-pending-cops`
66
- `rubocop -a #{FACTORY_FOLDER} --enable-pending-cops`
65
+ `rubocop -A #{SOQL_OBJECT_FOLDER} --enable-pending-cops`
66
+ `rubocop -A #{FACTORY_FOLDER} --enable-pending-cops`
67
67
  end
68
68
 
69
69
  private
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '1.0.2'
5
+ VERSION = '1.1.0'
6
6
  end
@@ -8,6 +8,7 @@ Soaspec.log_warnings = false # Log any API warnings
8
8
  Soaspec::SpecLogger.progname = 'Leaps' # Program name shown in logs
9
9
  Soaspec::OAuth2.request_message = false # Don't display message explaining OAuth request
10
10
  Soaspec::OAuth2.retry_limit = 1 # Retrying for OAuth token too many times results in user locked out
11
+ require 'active_support/isolated_execution_state'
11
12
  require 'active_support/core_ext/integer/time' # Creating time objects
12
13
  require 'leap_salesforce/parameters' # Important to load this first
13
14
  require 'leap_salesforce/ext/string'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leap_salesforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - IQA
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-01-29 00:00:00.000000000 Z
12
+ date: 2022-01-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -99,16 +99,16 @@ dependencies:
99
99
  name: activerecord
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - '='
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '7'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ">="
109
+ - - '='
110
110
  - !ruby/object:Gem::Version
111
- version: '0'
111
+ version: '7'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: colorize
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -370,7 +370,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  - !ruby/object:Gem::Version
371
371
  version: '0'
372
372
  requirements: []
373
- rubygems_version: 3.0.6
373
+ rubygems_version: 3.2.3
374
374
  signing_key:
375
375
  specification_version: 4
376
376
  summary: Helps with setting up integrated automated test frameworks against Salesforce.