nonnative 1.56.0 → 1.57.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c282877137dc63a9bfbf14ab857e666e084032e8c32a21b9c9c4241d159e67b2
4
- data.tar.gz: 3b8b0e15d4e745af0fc8bc30317b448e1edea8bd294227d265ae348479ec8c16
3
+ metadata.gz: 18c507d1d80df16859377563fe1d6ee1c9eb5f2ddd8fdf3d2993f51b6bdb2b62
4
+ data.tar.gz: d68f4c11e44caa4603bf1c6d710b84dfcc7736b651d1386908b5bd68ed92faf9
5
5
  SHA512:
6
- metadata.gz: 229fdd9c01f0538cd458a05ae58225c95defe944f8b5662aa0fc668a354fd4ca897cb1a2d40f97ca7a4c729b4ad52283b8c6ff88398e314a818c4b5bf411afcb
7
- data.tar.gz: 0f2f5c89745c517ae6855818844d5eb2f685f9c0aef0b674c4a242ab3604233cdf0a48498290705aaaff36e1b0b5c6c27bd0eae4cff83ef91ee79682c20fa973
6
+ metadata.gz: c1bbef60259712ff852c2fccf0000fd03744bda978f4e31ee0a5c462a09d1ff523af7ec2aaabba6decd5ef24bec8c26b7d3e415ab3506cb7de06889ace9257ff
7
+ data.tar.gz: ed09e907cf065b93f4b320830ff9eafeebac36b0341c40e335500e76868148bfaead29291b26312cf7f7d7fa1130a73b762ac2ace354d90851e9c62f93e5f994
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ AllCops:
4
4
  NewCops: enable
5
5
 
6
6
  Layout/LineLength:
7
- Max: 160
7
+ Max: 165
8
8
 
9
9
  Metrics/MethodLength:
10
10
  Max: 20
data/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.57.1](https://github.com/alexfalkowski/nonnative/compare/v1.57.0...v1.57.1) (2022-03-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **command:** make sure we recreate with every execution ([#113](https://github.com/alexfalkowski/nonnative/issues/113)) ([efe2c76](https://github.com/alexfalkowski/nonnative/commit/efe2c761a54eacfa2e4afe99afea2a9c2f8eeb74))
11
+
12
+ ## [1.57.0](https://github.com/alexfalkowski/nonnative/compare/v1.56.1...v1.57.0) (2022-03-28)
13
+
14
+
15
+ ### Features
16
+
17
+ * **go:** make sure we generate a unique file ([#111](https://github.com/alexfalkowski/nonnative/issues/111)) ([d260baf](https://github.com/alexfalkowski/nonnative/commit/d260baf8801e73660052d095935de67bbdca207c))
18
+
19
+ ### [1.56.1](https://github.com/alexfalkowski/nonnative/compare/v1.56.0...v1.56.1) (2022-03-28)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **process:** use key for env ([#110](https://github.com/alexfalkowski/nonnative/issues/110)) ([48f1959](https://github.com/alexfalkowski/nonnative/commit/48f1959cb36047ed88e1407313ef4828182142eb))
25
+
5
26
  ## [1.56.0](https://github.com/alexfalkowski/nonnative/compare/v1.55.0...v1.56.0) (2022-03-28)
6
27
 
7
28
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.56.0)
4
+ nonnative (1.57.1)
5
5
  concurrent-ruby (~> 1.0, >= 1.0.5)
6
6
  cucumber (>= 7, < 8)
7
7
  get_process_mem (~> 0.2.1)
data/README.md CHANGED
@@ -65,7 +65,7 @@ Nonnative.configure do |config|
65
65
 
66
66
  config.process do |p|
67
67
  p.name = 'start_1'
68
- p.command = 'features/support/bin/start 12_321'
68
+ p.command = -> { 'features/support/bin/start 12_321' }
69
69
  p.timeout = config.strategy.timeout
70
70
  p.port = 12_321
71
71
  p.log = 'features/logs/12_321.log'
@@ -77,7 +77,7 @@ Nonnative.configure do |config|
77
77
 
78
78
  config.process do |p|
79
79
  p.name = 'start_2'
80
- p.command = 'features/support/bin/start 12_322'
80
+ p.command = -> { 'features/support/bin/start 12_322' }
81
81
  p.timeout = 0.5
82
82
  p.port = 12_322
83
83
  p.log = 'features/logs/12_322.log'
@@ -70,9 +70,9 @@ module Nonnative
70
70
  go = process['go']
71
71
  if go
72
72
  params = go['parameters'] || []
73
- Nonnative.go_executable(go['output'], go['executable'], go['command'], *params)
73
+ -> { Nonnative.go_executable(go['output'], go['executable'], go['command'], *params) }
74
74
  else
75
- process['command']
75
+ -> { process['command'] }
76
76
  end
77
77
  end
78
78
 
@@ -17,10 +17,11 @@ module Nonnative
17
17
  attr_reader :exec, :output
18
18
 
19
19
  def flags(cmd, params)
20
+ suffix = SecureRandom.alphanumeric(4)
20
21
  m = File.basename(exec, File.extname(exec))
21
22
  p = params.gsub(/\W/, '')
22
23
  name = [m, cmd, p].reject(&:empty?).join('-')
23
- path = "#{output}/#{name}"
24
+ path = "#{output}/#{name}-#{suffix}"
24
25
 
25
26
  [
26
27
  "-test.cpuprofile=#{path}-cpu.prof",
@@ -55,11 +55,11 @@ module Nonnative
55
55
  environment = service.environment || {}
56
56
  environment = environment.transform_keys(&:to_s).transform_values(&:to_s)
57
57
 
58
- environment.each do |k, v|
59
- environment[k] = ENV[k] || environment[v]
58
+ environment.each_key do |k|
59
+ environment[k] = ENV[k] || environment[k]
60
60
  end
61
61
 
62
- spawn(environment, service.command, %i[out err] => [service.log, 'a'])
62
+ spawn(environment, service.command.call, %i[out err] => [service.log, 'a'])
63
63
  end
64
64
 
65
65
  def process_exists?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.56.0'
4
+ VERSION = '1.57.1'
5
5
  end
data/lib/nonnative.rb CHANGED
@@ -4,6 +4,7 @@ require 'socket'
4
4
  require 'timeout'
5
5
  require 'yaml'
6
6
  require 'open3'
7
+ require 'securerandom'
7
8
 
8
9
  require 'grpc'
9
10
  require 'sinatra'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.56.0
4
+ version: 1.57.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski