Skip to the content.

Table of Contents

We will be grateful to see you in the ranks of the contributors! We have some issues.

Development

Development takes place on GitHub, where the git-flow branch structure is used:

Prepare development environment

It is recommended to use Unix systems. You can use free Oracle Virtualbox and Ubuntu.
Setup script for Ubuntu system (python version must be 3.8+):

python3 -m pip install tox
python3 -m pip install .[tests]
python3 -m pytest -munit

# install ruby (required for pre-commit)
sudo apt install ruby

# run pre-commit
python3 -m pre_commit install
python3 -m pre_commit run --all-files

If you use another system procedure might be different.
General script:

python -m pip install tox
python -m pip install .[tests]
python -m pytest -munit

# Install `pre-commit` hooks after clone:
pre-commit install
pre-commit run --all-files

Tests

Command snippet to run tests via tox

# Run unit tests
tox
# Run integration tests
tox -- -mintegration
# Run Unit and Integration tests
tox -- ""

Unit

If you can write unit tests, please do so. How to run them:

python -m pytest -munit

Integration

We also have some integration test. But you have to prepare your environment a little before you can run these tests.

  1. Get Trial License Key from JFrog
  2. Run Artifactory Pro (only Pro support full REST API) inside docker by command:
    docker run --name artifactory-pro -d -p 8081:8081 -p8082:8082 docker.bintray.io/jfrog/artifactory-pro
    
  3. Open http://localhost:8081 and wait until it’ll be ready
  4. Login with admin \ password and complete initialize steps:
    1. Change password to P@ssw0rd. It’s important to use exactly this password, we hardcoded it in test.cfg
    2. Change token to real one in test.cfg. Token authentation method is for some special components, like Projects
    3. Install trial license

That all, try to run integration tests!

# Run with current python
python -mpytest -mintegration

# Run through all versions with we do support
tox -- -mintegration

Some useful command with docker:

# Stop artifactory, but save License and user\password
docker stop artifactory-pro

# Start stopped Artifactory. 
docker start artifactory-pro

# Remove installed Artifactory. You'll have to comlete initialize steps again!
docker rm artifactory-pro