Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Unit testing capabilities & manual dependency management #5384

Open
fengkiej opened this issue Feb 26, 2025 · 1 comment
Open

feature: Unit testing capabilities & manual dependency management #5384

fengkiej opened this issue Feb 26, 2025 · 1 comment
Assignees

Comments

@fengkiej
Copy link

fengkiej commented Feb 26, 2025

Referencing my previous feature request
#4981
#4982

In my current use case, I proceed with hackish way by using inlined test section in my code to create unit test, reducing code readability

Proposing feature request:

  • Code: Main script editing area
  • Dependencies: Package and library management
  • Unit Test: Integrated testing environment

Example view:
Image

I think these features (see tabs for Code, Dependencies, Unit Test) for custom scripts & custom step scripts would:

  1. Improve DX
  2. Promotes software development best practices
  3. Making dependencies management more explicit and visible
  4. Encouraging test-driven development
  5. Improving user's code maintenance
  6. Differentiate Windmill from other workflow solutions with built-in testing capabilities and explicit dependencies management
  7. Aid client's technical stakeholder buy-in and confidence for long-term maintainability, for workflows built with Windmill
@rubenfiszel
Copy link
Contributor

Scripts have annotation that allow them to restrict their dependencies, we believe it's the right way a user should influence the lockfile in the UI, but they should not change the lockfile directly.

For manual dependency management and unit testing, this is something that we do not plan to have exposed in the UI as it's already possible to do using local development and works particularly well with git sync and deployment to staging/prod associated to it because you can have those be tied to your CI and a preliminary step to merge to your prod branch. It's a better separation of concerns but right now the biggest challenge for it is to make units tests more easily compatible with windmill lockfiles and main function format. But today, with a bit of work, it's already possible to run unit tests for each function with the testing framework of your choice locally as windmill scripts are not tied to the windmill runtime and one can run them locally: https://www.windmill.dev/docs/advanced/local_development/run_locally.

Note that even for local development, we recommend using wmill script generate-metadata to have the lockfiles be automatically generated and to never actually modify it yourselves. See https://www.windmill.dev/docs/advanced/dependencies_in_python#pinning-dependencies-and-requirements and https://www.windmill.dev/docs/advanced/dependencies_in_typescript#lockfile-per-script-inferred-from-imports-standard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants