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

Documentation for directory structure and working directory for complex locust projects #500

Closed
justiniso opened this issue Nov 8, 2016 · 2 comments

Comments

@justiniso
Copy link
Member

The documentation provided is quite lacking in locustfiles that do any imports of helper modules. It seems to imply that you will always have a completely flat directory structure of locustfiles like:

cwd/
    locustfile1.py
    locustfile2.py
    locustfile3.py

But one of the big advantages of locust is creating complex user behaviors that may require additional logic and data to be shared across locustfiles, such as configs or auth. Similar to how most applications are run, we should think about whether we want to continue to have the locustfile be the "root" from which to import or if we want to have a root dir that contains multiple locustfiles. e.g.:

locustproject/
    locustfiles/
        locustfile1.py
        locustfile2.py
        locustfile3.py
    helpers/
        auth.py
        config.py

See #484, which proposes including the cwd in the path, but I think this might have undesirable side effects for current integrations. I think we can go that route, but official docs should recommend only running from the project root (locustproject) in the example above.

@pwnage101
Copy link
Contributor

I gave it a crack (#501). I might be missing some spots, but first let me know if you think this is better or worse. I think my change sufficiently exposes alternatives to flat-directory projects.

@justiniso
Copy link
Member Author

This is in the docs now and the original PR is being reviewed.

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