avm-git 0.1.0 → 0.2.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: b981cbcaacc3f23090895cd39d733ce3bd76067c7944331aaf5cd163bc6a39f7
4
- data.tar.gz: ffffcbf994c1eb3a8e5464d5cd7b2ef5e8a82ad0ba29bc1263614dd7f213d404
3
+ metadata.gz: d0d9b01de7c9963912122916516e1865d3aa9189d1dcdbb6d3357232200b3943
4
+ data.tar.gz: f7b440303d272191767c46f98f9d5a56e723caca304151033ddc3361b20294cb
5
5
  SHA512:
6
- metadata.gz: 14f3e4c7c070e3479a23964439ceb5660772fe59106a85ea854918a487a24f13ce0530f103a86aa7ab9e8c72955e1c7408b31e9818938dbd010d781d0c9cd94f
7
- data.tar.gz: 073e0cc2d85ad2c652467df568f64ddf1a1c5e3b14aff72bb4957767f2d2b33a72a0f4b0e3cb0586fb40afd916cf7015c4a9c235ab014b1c1cf2c31f1c4ba078
6
+ metadata.gz: 76101b99b34145270d3464d1a4163d1107dceee14af57b0cafb520f89fd49ba59ffaf5c5972c22ab270abda64196a8c0d98f060a63ff9c081738ca3998bb1714
7
+ data.tar.gz: b181e8e2d5f05929c57408ef392d9658bd3999dce78a03ee75a3cbb927bb252310f1d2b4cb0ed04f2d133763def2995dcdbe42e93d36b55b011d36cf21370085
@@ -2,6 +2,8 @@
2
2
 
3
3
  require 'avm/sources/configuration'
4
4
  require 'avm/result'
5
+ require 'avm/sources/base'
6
+ require 'avm/sources/tests/builder'
5
7
  require 'eac_ruby_utils/fs/temp'
6
8
 
7
9
  module Avm
@@ -10,33 +12,26 @@ module Avm
10
12
  class Complete
11
13
  module Test
12
14
  def test_result
13
- test_command = configuration.if_present(&:any_test_command)
14
- return ::Avm::Result.success('unconfigured') if test_command.blank?
15
-
16
- infom "Running test command \"#{test_command}\"..."
17
- result = test_command.execute
18
- test_result_log(result)
19
- if result.fetch(:exit_code).zero?
20
- ::Avm::Result.success('yes')
21
- else
22
- ::Avm::Result.error('no')
15
+ infom 'Running tests...'
16
+ test_performer.units.each do |single|
17
+ return ::Avm::Result.error(test_failed_result_message(single)) if single.failed?
23
18
  end
19
+ ::Avm::Result.success('all passed')
24
20
  end
25
21
 
26
22
  private
27
23
 
28
- def test_result_log(result)
29
- stdout_file = ::EacRubyUtils::Fs::Temp.file
30
- stderr_file = ::EacRubyUtils::Fs::Temp.file
31
- stdout_file.write(result.fetch(:stdout))
32
- stderr_file.write(result.fetch(:stderr))
33
- infov ' * Exit code', result.fetch(:exit_code)
34
- infov ' * STDOUT', stdout_file.to_path
35
- infov ' * STDERR', stderr_file.to_path
24
+ def test_failed_result_message(single)
25
+ { 'Source' => single, 'STDOUT' => single.logs[:stdout],
26
+ 'STDERR' => single.logs[:stderr] }.map { |k, v| "#{k}: #{v}" }.join(', ')
36
27
  end
37
28
 
38
- def configuration_uncached
39
- ::Avm::Sources::Configuration.find_by_path(@git)
29
+ def test_performer
30
+ ::Avm::Sources::Tests::Builder
31
+ .new(::Avm::Sources::Base.new(@git))
32
+ .include_main(true)
33
+ .include_subs(true)
34
+ .performer
40
35
  end
41
36
  end
42
37
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Git
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-git
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-13 00:00:00.000000000 Z
11
+ date: 2021-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm-files