From 38725e3b0662e5911fca1668c123ee7285801238 Mon Sep 17 00:00:00 2001 From: Michal Konečný Date: Sep 02 2020 05:04:07 +0000 Subject: Add testing env guide to README Signed-off-by: Michal Konečný --- diff --git a/README.rst b/README.rst index 0504b3c..97e8d6b 100644 --- a/README.rst +++ b/README.rst @@ -77,7 +77,62 @@ modify your PYTHONPATH to find them. Run with:: $ PYTHONPATH=.:/path/to/pagure/checkout pytest pagure_distgit_tests/ -You can use our requirements-testing.txt to install testing dependencies with pip: +You can use our requirements-testing.txt to install testing dependencies with pip:: + $ pip install -r /path/to/pagure/checkout/requirements.txt $ pip install -r /path/to/pagure/checkout/requirements-testing.txt $ pip install -r requirements-testing.txt + +Setting up testing env +====================== + +The dist-git needs pagure to run. This guide will use the existing pagure vagrant setup with +few modifications. First you need to clone pagure:: + + $ git clone https://pagure.io/pagure.git + $ cd pagure + +Next step is to copy `Vagrantfile.example` as `Vagrantfile` to git root folder:: + + $ cp dev/Vagrantfile.example Vagrantfile + +Add mount point for the dist-git repository. You need to add the following to +`Vagrantfile`:: + + config.vm.synced_folder "/path/to/pagure-dist-git", "/srv/pagure-dist-git", type: "sshfs" + +Create the vagrant machine and ssh into it:: + + $ vagrant up && vagrant ssh + +In the vagrant we need to do a few more steps. First add dist-git specific tables and +some test data:: + + $ cd /srv/pagure-dist-git/ + $ sudo -u git python createdb.py -c /etc/pagure/pagure.cfg + $ cd /srv/pagure + $ sudo -u git PAGURE_CONFIG="/etc/pagure/pagure.cfg" python dev-data.py -a + +Add theme to `/etc/pagure/pagure.cfg`:: + + THEME = 'srcfpo' + +Update `/etc/systemd/system/pagure.service` with env variables:: + + Environment="PAGURE_PLUGINS_CONFIG=/srv/pagure-dist-git/pagure_distgit_config" + Environment="PYTHONPATH=/srv/pagure-dist-git" + +Stop the running pagure instance:: + + $ pstop + +Reload systemd daemons:: + + $ sudo systemctl daemon-reload + +Start the pagure instance again:: + + $ pstart + +Now you should have running instance of pagure with dist-git on `http://localhost:5000`. +Nice hacking! :-)