- Using ./run --develop ensures that the last list of dependencies are picked up
from current source directory instead of list of dependencies from system
configuration.
- Using sudo -u plinth ensures that even if any temporary files are created,
they belong to the plinth user instead of root user.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Add pytest hooks to ignore all functional tests if pytest_bdd is not
installed.
- Update pytest hooks to skip tests in file named 'test_functional.py' if
--include-functional argument is not provided.
- Move functional_tests/install.py into plinth/tests/functional and update
reference in Vagrantfile.
- Move scenario files into individual app folders. Rename them after the app
they are testing. Merge TODO items listed in todo.org into corresponding feature
files.
- Add test_functional.py in each app to build tests from the features file using
pytest_bdd.
- Move all step_definitions, support and data into plinth/tests/functional/.
Include all step_definitions from conftest.py. Update to relative imports
instead of absolute imports.
Tests performed:
- Run py.test-3 --collect-only shows all functional tests and lists 574 tests.
No errors show that name of feature files are correct. The number says that all
functional test features are included.
- Remove pytest_bdd (or modify the import name) and run py.test-3 --collect-only
skips collecting all functional tests and shows only 300+ tests.
- Run functional tests for a few apps with py.test-3 --include-functional -m
app. For storage, deluge.
- Run unit tests with py.test-3. Functional tests are listed by skipped.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
These files are not installed on the system and don't end up in the Debian
package. They pose not threat of causing a configuration file prompt.
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
- Add functional tests
- Add unit tests for samba views
- New dependency for running functional tests: smbclient
- Make port configurable for the smbclient
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
It's now possible to run the tests in the VM more easily
without copy-pasting too much from HACKING.md.
`vagrant provision --provisiion-with tests` will take care of the dependencies.
freedombox/plinth#1521 - Provision VM to run function functional tests
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Running plinth as root is causing preventable permission errors in production.
This commit makes the necessary changes to run plinth as the user plinth so that
permission errors can be caught early and prevented.
- Give ownership of all files in the mounted directory to plinth
- Add permissions in sudoers file so that plinth can run scripts in
/vagrant/actions as superuser
- Move scripts that run on vagrant triggers to a separate directory
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
- Disable automatic upgrades earlier in the script. This makes it more
likely that unattended-upgrades will be disabled before it has a
chance to run.
- Move apt commands to the end. In the event that unattended-upgrades
is running anyway, these command can fail and cause further steps to
be skipped.
Closes#1506
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
The vagrant box after being destroyed and created doesn't have ncurses-term
installed. Proactively install it to avoid the problem.
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Moved some frequently required operations to the Vagrantfile.
Newcomers to the project almost always face the issue of port 8000 not being
available. Disabling system Plinth and running only the development version
solves this issue.
Automatic upgrades are a frequent blocker for development and an unnecessary
annoyance on a development setup.
- Update documentation about vagrant file changes
- Remove plinth restart step
Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This will not install all the dependencies of Plinth but will install the
dependencies required for essential modules to setup properly.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
- Add license header
- Let setup.py decide the Python interpreter to use
- Don't make a copy of the project directory making it easier to
re-provision.
- Show a message on how to proceed after bringing up the VM