- test "pipeline instance arv-refresh-on-log-event" do
- Thread.current[:arvados_api_token] = @@API_AUTHS["admin"]['api_token']
- # Do something and check that the pane reloads.
- p = PipelineInstance.create({state: "RunningOnServer",
- components: {
- c1: {
- script: "test_hash.py",
- script_version: "1de84a854e2b440dc53bf42f8548afa4c17da332"
- }
- }
- })
-
- visit(page_with_token("admin", "/pipeline_instances/#{p.uuid}"))
-
- assert_text 'Active'
- assert page.has_link? 'Pause'
- assert_no_text 'Complete'
- assert page.has_no_link? 'Re-run with latest'
-
- p.state = "Complete"
- p.save!
-
- assert_no_text 'Active'
- assert page.has_no_link? 'Pause'
- assert_text 'Complete'
- assert page.has_link? 'Re-run with latest'
- end
-
- test "job arv-refresh-on-log-event" do
- Thread.current[:arvados_api_token] = @@API_AUTHS["admin"]['api_token']
- # Do something and check that the pane reloads.
- p = Job.where(uuid: api_fixture('jobs')['running_will_be_completed']['uuid']).results.first
-
- visit(page_with_token("admin", "/jobs/#{p.uuid}"))
-
- assert_no_text 'complete'
- assert_no_text 'Re-run job'
-
- p.state = "Complete"
- p.save!
-
- assert_text 'complete'
- assert_text 'Re-run job'
- end
-
- test "dashboard arv-refresh-on-log-event" do
- Thread.current[:arvados_api_token] = @@API_AUTHS["admin"]['api_token']
-
- visit(page_with_token("admin", "/"))
-
- assert_no_text 'test dashboard arv-refresh-on-log-event'
-
- # Do something and check that the pane reloads.
- p = PipelineInstance.create({state: "RunningOnServer",
- name: "test dashboard arv-refresh-on-log-event",
- components: {
- }
- })
-
- assert_text 'test dashboard arv-refresh-on-log-event'
- end
-