Class: HotCell::Fixtures::Environment

Inherits:
Operation
  • Object
show all
Defined in:
lib/hot_cell/test_operations.rb

Overview

Reports what an exec'd tool can see of its environment, and what the worker itself can see, so a test can prove the canary was really there before proving the tool never got it.

Constant Summary

Constants inherited from Operation

Operation::READ_BYTES

Instance Method Summary collapse

Methods inherited from Operation

abstract_operation, abstract_operation?, before_fork, before_worker_boot, inherited, limits, operation, operation_name, #run_tool, unreadable

Instance Method Details

#perform(_inputs, _outputs, env: {}, canary: nil) ⇒ Object



324
325
326
327
328
329
# File 'lib/hot_cell/test_operations.rb', line 324

def perform(_inputs, _outputs, env: {}, canary: nil)
  result = run_tool "env", env: env

  { seen: result.out.lines.map(&:chomp).sort, worker_saw: ENV[canary.to_s],
    ok: result.ok? }
end