Hi community, I am working on <enhancing the set_s...
# contribute
n
Hi community, I am working on enhancing the set_signal function for FlyteRemote. Since I can not find examples or tests showing its usage, I would like to check if I am on the right track. I ran this file but found out that the set_signal doesn’t work, so the workflow was stuck without passing the
wait_for_input
gate. Am I using the function wrong? Thanks!
I am working on this integration test, but Flyte states that the signal does not exist from here. Did I miss anything? The conditional_wf is here.
Copy code
def test_signal_approve_reject(register):
    remote = FlyteRemote(Config.auto(config_file=CONFIG), PROJECT, DOMAIN)

    conditional_wf = remote.fetch_workflow(name="basic.conditional_wf.signal_test_wf", version=VERSION)

    execution = remote.execute(conditional_wf, inputs={"data": [1.0, 2.0, 3.0, 4.0, 5.0]})

    # remote.set_input("title-input", execution.id.name, value="my report")
    # remote.approve("review-passes", execution.id.name)

    remote.set_signal("title-input", execution.id.name, value="my report")
    remote.set_signal("review-passes", execution.id.name, value=True)
    remote.wait(execution=execution, timeout=datetime.timedelta(minutes=5))
    assert execution.outputs["o0"] == {"title": "my report", "data": [1.0, 2.0, 3.0, 4.0, 5.0]}

    execution = remote.execute(conditional_wf, inputs={"data": [1.0, 2.0, 3.0, 4.0, 5.0]})
    # remote.set_input("title-input", execution.id.name, value="my report")
    # remote.reject("review-passes", execution.id.name)

    remote.set_signal("title-input", execution.id.name, value="my report")
    remote.set_signal("review-passes", execution.id.name, value=False)
    remote.wait(execution=execution, timeout=datetime.timedelta(minutes=5))
    assert execution.outputs["o0"] == {"invalid_report": True}