Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
Some small changes to make the test suite behave with SalsaCI were
required:

contrib/docker/Makefile:
  - The "run" target now runs docker-compose detached.
  - The "tests" target does not need to run interactively.

contrib/docker/scripts/run-tests:
  - We need to run only the CI tests here, otherwise
    producesReferenceDb times out.

.gitmodules:
  - Switch from SSH to HTTPS for submodule cloning. SSH connections were
    not working on my tests.
  • Loading branch information
rul authored and matthieucan committed May 1, 2021
1 parent 719a18f commit de9fa18
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
16 changes: 16 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive

build:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- apk add docker-compose make
script:
- cd contrib/docker
- make build
- make update-db
- make run
- make tests
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "testdata"]
path = testdata
url = git@salsa.debian.org:qa/debsources-testdata.git
url = https://salsa.debian.org/qa/debsources-testdata.git
[submodule "archvsync"]
path = archvsync
url = https://ftp-master.debian.org/git/archvsync.git
4 changes: 2 additions & 2 deletions contrib/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ update-db:
docker-compose run debsources /opt/db-update

run:
docker-compose up
docker-compose up -d

start-apache:
docker exec -it docker_debsources_1 apache2ctl start
Expand All @@ -16,4 +16,4 @@ attach:
docker exec -it docker_debsources_1 /bin/bash

tests:
docker exec -it docker_debsources_1 /opt/run-tests
docker exec docker_debsources_1 /opt/run-tests
4 changes: 3 additions & 1 deletion contrib/docker/scripts/run-tests
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash
/opt/db-init
nosetests3 -v /opt/debsources/lib/debsources/tests/

cd /opt/debsources
make test-travis

0 comments on commit de9fa18

Please sign in to comment.