简体   繁体   中英

toxresult_upload permission in devpi index

I am using the Python devpi server, and when I create an index, it adds a default a setting acl_toxresult_upload=:ANONYMOUS: , but I cannot find out what it means.

When I view the index in the web interface, it shows:

permissions

toxresult_upload
    Special: ANONYMOUS 

upload
    Users: my-user 

I googled it, but could not find any explanation of what it means. The only thing I could find was a python test that indicates it has something to do with uploading tests, but I'm not sure what that means regarding a Pypi index.

    # anonymous may upload tests
    assert with_user(permissionrequest, None).has_permission(
        'toxresult_upload', StageACL(stage, False))

devpi supports running tests for an uploaded package with tox on the client side. The process is roughly the following:

  1. create the dist (eg python setup.py sdist ). For tests to work, the distribution must include the test scripts and the tox.ini config.
  2. upload the dist to devpi , eg

     devpi upload --index hoefling/dev dist/mypkg-0.1.tar.gz 
  3. run the tests via

     devpi test --index hoefling/dev mypkg 

    This will download the dist from the specified index and start the test run as configured in tox.ini .

  4. once the tests finish, devpi-client will upload the test results to the server so they can be viewed anytime via the web UI: 在此处输入图片说明 When clicking on the tests link, you will land on the page showing the test run overview:

在此处输入图片说明 By clicking on the links referring to the separate test runs, you can inspect the test run logs in details.

Now, acl_toxresult_upload , similar to acl_upload , is the list of users that are allowed to upload test results to that index. acl_toxresult_upload=:ANONYMOUS: means that anyone can run devpi test --index your_index yourpkg and upload the test results. If you want to restrict the access, do it the same way you restrict the package upload access:

$ devpi index your_index acl_toxresult_upload=me,admin,ci-bot

Docs: devpi test: testing an uploaded package .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM