Page MenuHomePhabricator

Add test and lint to the CI setup for PAWS
Closed, ResolvedPublic

Description

PAWS currently only runs the docker builds for pull requests in Travis. Since PRs are now required to merge, it seems like a good idea to have CI test/lint as part of error prevention before merging.

Proposed initial options are pylint/flake8 and 'helm lint'. These don't do a lot of legitimate testing, but they will catch totally invalid code as well as help maintain some coding standards.

This will be helpful after the rebuild is done and probably shouldn't start until then because there's things to mess with on the deploy-hook side first.

Event Timeline

One other thing I'm seeing in this. We can make this easily deployable by helm as well as managed well via the deploy-hook for builds if we tag the latest build with :latest as well as the random string in the end. Then we can set the default image tag to latest in the values.yaml. Sane defaults are then there without scripting around the helm command (which shouldn't be needed for standard use cases).

nskaggs triaged this task as Medium priority.Aug 11 2020, 4:26 PM

Seems to work. https://travis-ci.com/github/toolforge/paws/builds/179349473
The pushed images won't conflict with anything deployed at the moment. However, I am curious about testing the linting workaround I did here: https://github.com/toolforge/paws/blob/ci-improvements/images/singleuser/user-config.py#L6-L10

The hope is that pywikibot does not care about that, but I need to make sure.

Ok, that works! More passes in the future to restore the deployhook and allow testing for validity of the generated manifests from the helm chart.