Class: Lemans::Store

Inherits:
Object
  • Object
show all
Defined in:
lib/lemans/store.rb

Overview

Store is responsible for storing trial results and querying them later.

Direct Known Subclasses

Lemans::Stores::FS

Instance Method Summary collapse

Instance Method Details

#delete(result) ⇒ Object

Deletes the result with everything it stored (artifacts included). Returns something truthy on success, nil otherwise

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/lemans/store.rb', line 29

def delete(result)
  raise NotImplementedError
end

#fetchObject

Returns all run records

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/lemans/store.rb', line 13

def fetch
  raise NotImplementedError
end

#query(**filters) ⇒ Object

Returns the run records matching the filters

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/lemans/store.rb', line 18

def query(**filters)
  raise NotImplementedError
end

#save(result) ⇒ Object

Persist the result

Raises:

  • (NotImplementedError)


34
35
36
# File 'lib/lemans/store.rb', line 34

def save(result)
  raise NotImplementedError
end

#save_artifact(result, contents, path:) ⇒ Object

Persist the result's file artifact (contents could be eiher IO (file) or text).

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/lemans/store.rb', line 40

def save_artifact(result, contents, path:)
  raise NotImplementedError
end

#setupObject

Prepares the store



8
9
10
# File 'lib/lemans/store.rb', line 8

def setup
  # no-op
end

#unreadableObject

Returns stub records for results that exist but cannot be read



23
24
25
# File 'lib/lemans/store.rb', line 23

def unreadable
  []
end