Hi metaflow, quick question: I have a flow with ma...
# ask-metaflow
a
Hi metaflow, quick question: I have a flow with many steps; trying to think of the best way to make tests for each step without having to run the whole flow… my thought was to exploit the way subcommands call each step… something like: 1. create a “toy-test” run; save expected results locally. 2. “test” by (re)running each step independently. using something like
Copy code
python flow.py --quite --metadata local --environment local --datastore local --event-logger nullSidecarLogger --monitor nullSidecarMonitor --datastore-root .metaflow step <STEP-I-WANNA-TEST> --run-id <RUN-ID-OF-TOY-TEST-FLOW> --task-id XX --input-paths <PATH-TO-LOCAL-DATA> --retry-count 0 --max-user-code-retries 0 --namespace user:me
1. verify the output is as expected. This way I could isolate the step I wanted to test. I was wondering if this approach would work, or if there is a better pattern for isolated testing of a single step?
1
1
a
Hi Madison, we wouldn't recommend running the steps individually using Metaflow's internal implementation detail - it assumes many details and also can change at any point in time. Our recommendation would be to test the business logic independent of Metaflow. If you are interested in executing a flow from any arbitrary step, you can resume a prior execution using
python flow.py resume <step-name> --origin-run-id <run-id-to-resume>
a
ah ok. that makes sense to use resume thanks! I was having trouble isolating a “foreach” step… do you have any recommendations on how to resume a single task? or do you recommend running all tasks?
a
can you help me with your use case? there might be other alternatives we can possibly recommend