1
0
mirror of https://github.com/pypiserver/pypiserver synced 2024-11-09 16:45:51 +01:00
pypiserver/tests
Matthew Planchard d868005e1f
Docker improvements (#365)
* Docker improvements

This addresses much of what was brought up in #359. Specifically, it:

- Significantly improves testing for the Docker image, adding a
  `docker/test_docker.py` file using the regular pytest machinery to
  set up and run docker images for testing
- Hopefully addresses a variety of permissions issues, by being explicit
  about what access pypiserver needs and asking for it, only erroring
  if that access is not available
  - Requires RX permissions on `/data` (R to read files, X to list files
    and to be able to cd into the directory. This is important since
    `/data` is the `WORKDIR`)
  - Requires RWX permissions on `/data/packages`, so that we can list
    packages, write packages, and read packages.
  - When running in the default configuration (as root on Linux or
    as the pypiserver-named rootish user on Mac), with no volumes
    mounted, these requirements are all satisfied
  - Volume mounts still must be readable by the pypiserver user (UID
    9898) in order for the container to run. However, we now error early
    if this is not the case, and direct users to a useful issue.
  - If the container is run as a non-root, non-pypiserver user (e.g.
    because someone ran `docker run --user=<user_id>`, we try to run
    pypiserver as that user). Provided that user has access to the
    necessary directories, it should run fine.
- Fixes issues with running help and similar commands
- Updates the Docker image to use `PYPISERVER_PORT` for port
  specification, while still falling back to `PORT` for backwards
  compatibility
- Moves some docker-related things into a `/docker` directory
- Adds a `Makefile` for building a test fixture package sdist and wheel,
  so that test code can call `make mypkg` and not need to worry about it
  potentially building multiple times

The only issue #359 raises that's not addressed here is the one of
running pypiserver in the Docker container using some non-default server
for performance. I would like to do some benchmarking before deciding on
what to do there.
2021-02-06 11:28:15 -06:00
..
__init__.py Added init.py to tests 2016-05-12 20:02:10 -05:00
doubles.py Cleanup code to python 3.6 (#342) 2020-10-07 20:45:51 -05:00
sample_msg.html Use bottle's SimpleTemplate engine to avoid XSS on welcome-page (#77). 2015-02-22 18:43:35 +01:00
test_app.py Refactor storage operations into separate Backend classes (#348) 2021-02-02 11:44:29 -06:00
test_backend.py Refactor storage operations into separate Backend classes (#348) 2021-02-02 11:44:29 -06:00
test_config.py Docker improvements (#365) 2021-02-06 11:28:15 -06:00
test_core.py Refactor storage operations into separate Backend classes (#348) 2021-02-02 11:44:29 -06:00
test_docs.py Cleanup code to python 3.6 (#342) 2020-10-07 20:45:51 -05:00
test_init.py Docker improvements (#365) 2021-02-06 11:28:15 -06:00
test_main.py Docker improvements (#365) 2021-02-06 11:28:15 -06:00
test_manage.py Refactor storage operations into separate Backend classes (#348) 2021-02-02 11:44:29 -06:00
test_pkg_helpers.py Refactor storage operations into separate Backend classes (#348) 2021-02-02 11:44:29 -06:00
test_server.py Docker improvements (#365) 2021-02-06 11:28:15 -06:00
test-ignorelist Backwards-compatible argparse config (not yet in use) (#339) 2020-10-08 19:37:39 -05:00