Closed kwypchlo closed 2 years ago
Nice I like this.
We could even further improve the execution time if we build a node docker image with skynet-js already installed and ready to run tests.
I think this is reasonable. Then we just add it to the docker compose file and all ansible has to do it target it with a simple command. That also allows us to run integration tests on a cron job nightly if we wanted.
While this is true that tests are running much faster if they are run from a target machine, they were intentionally executed from a different machine so that they test portal end-to-end.
If e.g. firewall is misconfigured, we get passing tests but unreachable portal.
That is still the case, the docker image is totally isolated and uses an external domain to access the server so it tests it in the same way running from different server would.
This is a draft proof of concept
Currently integration tests are run from deploy machine against the server that is being deployed. This limits us in terms of the performance on integration tests that run in parallel and make up most of the deploy time. Instead, we can run those tests on the servers that are being deployed. Docker will clean up any leftovers after the tests are finished. It also dramatically simplifies the job, we could actually add it to "playbooks/tasks/portal-execute-commands.yml" instead.
Running integration tests on 4 servers in parallel.
Before (removed
serial: 1
from this playbook to run like it runs during deploy):After:
We could even further improve the execution time if we build a node docker image with skynet-js already installed and ready to run tests.