Is it possible to run flows locally without postin...
# ask-community
c
Is it possible to run flows locally without posting results on the UI? (for testing)
i
Yes, you can just call the flow as a function, without deployment
👎 1
c
@Igor try again
w
Do you mean unit-test? Try to use the prefect_test_harness https://docs.prefect.io/3.0/develop/test-workflows
c
No guys - sorry if I wasn't clear enough. What I am looking for is running anything locally without registering "runs" (tasks,flows) in the dashboard. Imagine going incognito - a bad bud intuitive analogy
b
Are you asking if its possible to run the python script that you defined but without a prefect server running (e.g.
prefect server start
?)
c
Nope... . 🤯 let me try one more time: I want to test flows and runs, usually invoked locally. The prefect api server is set to prod, the live cluster. While I run my "test" flows, I just don't want them to appear in the dashboard's statistics, nor logs. They run, but they never persist data and nothing will be displayed in the live dashboard. As if it were a dry run.
b
Hi Constantin, my thinking is that you could have a two prefect profiles. One profile can be used for running flows against the prod cluster, and the other could be used for running flows against a local prefect server that you spin up for testing flows. Whenever you want to do a dry run, you can switch the active profile that you're using to one for local testing, ie:
Copy code
prefect profile use my-local-profile
❤️ 1
I have a few profiles that I alternate between which point to my different Prefect Cloud environments, and local server