3 class PipelineTest < ActionDispatch::IntegrationTest
4 # These tests simulate the workflow of arv-run-pipeline-instance
5 # and other pipeline-running code.
7 def check_component_match(comp_key, comp_hash)
8 assert_response :success
9 built_json = json_response
10 built_component = built_json["components"][comp_key]
11 comp_hash.each_pair do |key, expected|
12 assert_equal(expected, built_component[key.to_s],
13 "component's #{key} field changed")
17 test "creating a pipeline instance preserves required component parameters" do
18 comp_name = "test_component"
20 repository: "test_repo",
21 script: "test_script",
22 script_version: "test_refspec",
23 script_parameters: {},
26 post("/arvados/v1/pipeline_instances",
27 {pipeline_instance: {components: {comp_name => component}}.to_json},
29 check_component_match(comp_name, component)
30 pi_uuid = json_response["uuid"]
33 get("/arvados/v1/pipeline_instances/#{pi_uuid}", {}, auth(:active))
34 check_component_match(comp_name, component)