Extend docker-compose commands info when debugging the CI

This commit is contained in:
Imobach González Sosa 2021-07-19 15:41:50 +01:00 committed by GitHub
parent 0fdf126e2e
commit 5dd64dc1f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,15 +111,17 @@ As mentioned before, the main repository uses GitHub Actions to automatically ru
### Debugging Failures in CI
The first step is to reproduce it when running it locally as described above.
To see all logs following command can be executed:
This section lists a few tricks to debug problems in the CI. You will use your local setup so, as a first step, you need to be able to run the tests as described in the previous section.
To see the logs from all the containers, the following command can be executed:
docker-compose -f dist/ci/docker-compose.yml logs -f --tail=10
To check content of any running container use this command ( in this case "api" container ) to get shell:
You can run commands in any container by using the docker-compose `exec` command. For instance, you can connect to a container through a shell with the following command (in this case, it will connect to the container behind the `api` service):
docker-compose -f dist/ci/docker-compose.yml exec api sh
Or you could check the API logs by issuing the following command:
docker-compose -f dist/ci/docker-compose.yml exec api sh -c 'tail -f /srv/www/obs/api/log/*.log'
Also OBS in container can be reached at `http://0.0.0.0:3000`. There are user "Admin" with password "opensuse".
To prevent cleaning in testsuite place `breakpoint()` in code to stop execution and drop to debugger.
If anything is missing for debugging, zypper can be used.