varar-runner 0.8.0 → 0.8.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: 46298c6e8b7301ae6a5853dec7ffd596f5a6d9025536eb8932af54bac545944d
4
- data.tar.gz: 67beb4b0519aece1442ab3ec0972eb6a5f41d6f5a68b72db022732f795a084bf
3
+ metadata.gz: 8b5851436b3132a8db0f86e7a70c593650192c6ba01bfe307a901dcafd9502c7
4
+ data.tar.gz: 7ef324ac2644295eebe76201fb378b1950f4845ee5552afdce20bc16ab6e8cef
5
5
  SHA512:
6
- metadata.gz: f5c0baf64a0643451fd6b0f70e482818086d609e8ff9168c5e9654e061ac7452d55a576301da196a5b6654731e19d47c953ff25c388f34267eb642d90f2afef6
7
- data.tar.gz: e701f85184c8738acd5dda28eda4a9b37db06c667c5e839224bc292c556bb9ef173095899fbe395e393f3691a9325e663411c69f971a1170c005832ba4bf0e42
6
+ metadata.gz: b1f528bfb4259284edccd9de1f6051b20cbd0e1448e2ac47b885a099280394a8d4a13bff240f26bd898a5b1bdf696806536854193e7ac67b41fad3d70e8768a4
7
+ data.tar.gz: 733508b44808f138ac5122c7aa67b0bae3354e61bf56e554ca482fade299931da1589f09cb11300d02a08777f877ca610f5db422c50dc039755d738e360993bc
@@ -18,6 +18,8 @@ module Varar
18
18
  def initialize
19
19
  @sources = {}
20
20
  @examples = {}
21
+ # Per oath: the other documents its steps were spliced in from (ADR 0016).
22
+ @documents = {}
21
23
  end
22
24
 
23
25
  # `<root>/.varar/<oath_path>.json` — the file the LSP watches.
@@ -47,9 +49,15 @@ module Varar
47
49
 
48
50
  # Accumulates one example's outcome; the oath's file is written once its
49
51
  # examples are in.
50
- def record(oath_path, source, result)
52
+ # `referenced_sources` carries the OTHER documents this oath's steps were
53
+ # spliced in from (ADR 0016), as path => source; their hashes go in the
54
+ # payload so a consumer can tell a stale failure from a live one.
55
+ def record(oath_path, source, result, referenced_sources = nil)
51
56
  @sources[oath_path] = source
52
57
  (@examples[oath_path] ||= []) << result
58
+ return if referenced_sources.nil? || referenced_sources.empty?
59
+
60
+ (@documents[oath_path] ||= {}).merge!(referenced_sources)
53
61
  end
54
62
 
55
63
  # Writes what has been recorded for `oath_path` and forgets it. Passing
@@ -59,11 +67,15 @@ module Varar
59
67
  recorded = @examples.delete(oath_path)
60
68
  return nil if recorded.nil? || recorded.empty?
61
69
 
70
+ documents = (@documents.delete(oath_path) || {}).sort.map do |path, text|
71
+ Core::ReferencedDocument.new(path: path, source_hash: Core::Hash32.hash_source(text))
72
+ end
62
73
  self.class.write(root, Core::OathResults.new(
63
- version: 1,
74
+ version: 2,
64
75
  oath_path: oath_path,
65
76
  source_hash: Core::Hash32.hash_source(@sources[oath_path]),
66
- examples: self.class.document_order(recorded)
77
+ examples: self.class.document_order(recorded),
78
+ documents: documents
67
79
  ))
68
80
  end
69
81
 
@@ -19,8 +19,8 @@ module Varar
19
19
 
20
20
  module_function
21
21
 
22
- def plan_oath(path, source, registry)
23
- Core::Plan.plan(Core::Parse.parse(path, source), registry)
22
+ def plan_oath(path, source, registry, workspace)
23
+ Core::Plan.plan(Core::Parse.parse(path, source), registry, workspace)
24
24
  end
25
25
 
26
26
  # Pair each PlannedExample with its lazy run closure, in plan order.
data/lib/varar/runner.rb CHANGED
@@ -9,7 +9,7 @@ module Varar
9
9
  # rendering, and the filesystem drift baseline store. Depends on the facade
10
10
  # and config; never on a test framework. Port of varar-runner.
11
11
  module Runner
12
- VERSION = '0.8.0'
12
+ VERSION = '0.8.1'
13
13
  end
14
14
  end
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: varar-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.8.0
18
+ version: 0.8.1
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.8.0
25
+ version: 0.8.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: varar-config
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.8.0
32
+ version: 0.8.1
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.8.0
39
+ version: 0.8.1
40
40
  description: Oath/step discovery, step loading, planning, failure rendering, and the
41
41
  drift baseline store.
42
42
  email: