deployagram-cucumber 0.1.0

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +14 -0
  3. data/README.md +8 -0
  4. data/lib/deployagram/cucumber.rb +47 -0
  5. metadata +93 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 7a81d34b8776eb382e53d719d9cf0daf1105df2b76107f5223f6d532e493bd3b
4
+ data.tar.gz: b63a36a92dca2cdc7eadde86a159e857c057d3492c2fa217c2e0fd99275d3de0
5
+ SHA512:
6
+ metadata.gz: 4772e1f0c3dd3296a211c7d770c3417718c377e59777f51155cd476606d087a4c3b0d11fa9377ac872a04407bcf4f80388cd4c0d3dc9504d45ae9ddf017e0364
7
+ data.tar.gz: 301cd89c7a73bd5af409f4651b2c4b22c3c30dcb1db9688bbac95fa4c8fa160d28dd80e449365a969f15a7ecc69ab6236810ee4b09551b354c0b83ff21725a92
data/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ DEPLOYAGRAM PROPRIETARY LICENSE
2
+
3
+ Copyright (c) 2025 Deployagram, Cookiebit and Andy Muir.
4
+
5
+ Permission is hereby granted to use this software solely for its intended purpose.
6
+
7
+ RESTRICTIONS:
8
+ - No modification of the software is permitted
9
+ - No reverse engineering, decompilation, or disassembly
10
+ - No redistribution without explicit written permission
11
+ - Source code remains proprietary and confidential
12
+ - Usage is limited to the compiled npm package (the distributed tarball) artifact only
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
data/README.md ADDED
@@ -0,0 +1,8 @@
1
+ # deployagram-cucumber
2
+
3
+ Cucumber hooks that instrument Gherkin service tests with Deployagram. The Cucumber equivalent of `deployagram-minitest`
4
+ and `deployagram-rspec`. Requires the `cucumber` gem in the test's Gemfile.
5
+
6
+ Depends on: `deployagram-logger-client`, `deployagram-environment`, `deployagram-core`.
7
+
8
+ Part of the Deployagram Ruby packages. See `../../README.md`.
@@ -0,0 +1,47 @@
1
+ require "deployagram/environment"
2
+ require "deployagram/proxy_config"
3
+
4
+ module Deployagram
5
+ # Cucumber hooks for Deployagram service tests. Call Deployagram::Cucumber.install from a support file, then call
6
+ # before_scenario from a Before hook, after_scenario from an After hook, and stop from an AfterAll hook. The
7
+ # environment starts once, the first time a scenario needs it. Each scenario posts the Proxy configuration before it
8
+ # runs, and ends its sequence diagram after it. Names are "<feature file>.<scenario name>".
9
+ module Cucumber
10
+ class << self
11
+ attr_reader :environment, :proxy_config
12
+
13
+ def install(proxy_config: {}, proxy: true, logger_environment: {})
14
+ @proxy_config = proxy_config
15
+ @proxy = proxy
16
+ @logger_environment = logger_environment
17
+ end
18
+
19
+ def proxy?
20
+ @proxy
21
+ end
22
+
23
+ def start
24
+ @environment ||= Environment.start(proxy: @proxy, proxy_config: @proxy_config,
25
+ logger_environment: @logger_environment)
26
+ end
27
+
28
+ def before_scenario(test_case)
29
+ start
30
+ ProxyConfig.post(environment.proxy.url, proxy_config) if proxy? && !proxy_config.empty?
31
+ end
32
+
33
+ def after_scenario(test_case)
34
+ environment.logger_client.mark_end(marker_for(test_case))
35
+ end
36
+
37
+ def stop
38
+ @environment&.stop
39
+ @environment = nil
40
+ end
41
+
42
+ def marker_for(test_case)
43
+ "#{File.basename(test_case.location.file)}.#{test_case.name}"
44
+ end
45
+ end
46
+ end
47
+ end
metadata ADDED
@@ -0,0 +1,93 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: deployagram-cucumber
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Deployagram
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: deployagram-logger-client
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ -
17
+ - "="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ -
25
+ - "="
26
+ - !ruby/object:Gem::Version
27
+ version: 0.1.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: deployagram-environment
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ -
33
+ - "="
34
+ - !ruby/object:Gem::Version
35
+ version: 0.1.0
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ -
41
+ - "="
42
+ - !ruby/object:Gem::Version
43
+ version: 0.1.0
44
+ - !ruby/object:Gem::Dependency
45
+ name: deployagram-core
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ -
49
+ - "="
50
+ - !ruby/object:Gem::Version
51
+ version: 0.1.0
52
+ type: :runtime
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ -
57
+ - "="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.1.0
60
+ description: "Starts the Deployagram Collector and HTTP Proxy once per run, posts the Proxy configuration before each scenario, and ends each scenario's sequence diagram after it. Requires the cucumber gem in the test's Gemfile."
61
+ email:
62
+ - andy@deployagram.com
63
+ executables: []
64
+ extensions: []
65
+ extra_rdoc_files: []
66
+ files:
67
+ - LICENSE
68
+ - README.md
69
+ - lib/deployagram/cucumber.rb
70
+ licenses:
71
+ - SEE LICENSE IN LICENSE
72
+ metadata:
73
+ rubygems_mfa_required: "true"
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ -
80
+ - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: "3.2"
83
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ -
86
+ - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: "0"
89
+ requirements: []
90
+ rubygems_version: 4.1.0
91
+ specification_version: 4
92
+ summary: Cucumber hooks that instrument Gherkin service tests with Deployagram
93
+ test_files: []