#121 Add testing env guide to README
Merged 3 years ago by pingou. Opened 3 years ago by zlopez.
zlopez/pagure-dist-git README  into  master

file modified
+56 -1
@@ -77,7 +77,62 @@ 

  

      $ 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! :-)

rebased onto 38725e3

3 years ago

Pull-Request has been merged by pingou

3 years ago
Metadata