dify icon indicating copy to clipboard operation
dify copied to clipboard

test: add scripts for running tests on api module both locally and CI jobs

Open bowenliang123 opened this issue 1 year ago • 2 comments

Description

  • use pytest-env to prepare system envs
  • move the system env into tool.pytest_env
  • create dedicated scripts for running python tests on api module
  • updated api/README for installing development packages and running tests
  • bump pytest to 8.x as pytest-env requires 7.4+

Type of Change

Please delete options that are not relevant.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update, included: Dify Document
  • [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • [ ] Dependency upgrade

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [ ] TODO

Suggested Checklist:

  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] My changes generate no new warnings
  • [ ] I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • [ ] optional I have made corresponding changes to the documentation
  • [ ] optional I have added tests that prove my fix is effective or that my feature works
  • [ ] optional New and existing unit tests pass locally with my changes

bowenliang123 avatar Apr 15 '24 13:04 bowenliang123

cc @takatost

bowenliang123 avatar Apr 15 '24 14:04 bowenliang123

sh is not available on Windows, looks like people who use Windows could not test it himself, is there a better solution? I guess bash support is required.

Yeuoly avatar Apr 17 '24 03:04 Yeuoly