Skip to content

Commit

Permalink
Merge pull request #5218 from ChrisBr/ci/inmemory-db
Browse files Browse the repository at this point in the history
[ci] Use in memory database in CI
  • Loading branch information
ChrisBr committed Jun 26, 2018
2 parents fb44389 + 4cf6278 commit 3bf1363
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ aliases:
EAGER_LOAD: 1
<<: *cc_test_reporter_id
- image: registry.opensuse.org/obs/server/unstable/container/leap/42.3/images/openbuildservice/mariadb:latest
command: /usr/lib/mysql/mysql-systemd-helper start
command: |
/bin/bash -c 'echo -e "[mysqld]\ndatadir = /dev/shm" > /etc/my.cnf.d/obs.cnf && cp -a /var/lib/mysql/* /dev/shm && /usr/lib/mysql/mysql-systemd-helper start'
name: db
- image: registry.opensuse.org/obs/server/unstable/container/leap/42.3/images/openbuildservice/memcached:latest
name: cache
Expand All @@ -21,7 +22,8 @@ aliases:
NOKOGIRI_USE_SYSTEM_LIBRARIES: 1
<<: *cc_test_reporter_id
- image: registry.opensuse.org/obs/server/unstable/container/leap/42.3/images/openbuildservice/mariadb:latest
command: /usr/lib/mysql/mysql-systemd-helper start
command: |
/bin/bash -c 'echo -e "[mysqld]\ndatadir = /dev/shm" > /etc/my.cnf.d/obs.cnf && cp -a /var/lib/mysql/* /dev/shm && /usr/lib/mysql/mysql-systemd-helper start'
name: db
- &restore_bundle_cache
keys:
Expand Down
6 changes: 3 additions & 3 deletions contrib/start_test_db
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
# Copy our data dir to the tmpfs mount
cp -a /var/lib/mysql/* /var/lib/mysql_tmpfs
cp -a /var/lib/mysql/* /dev/shm
# Remove all our databases
rm -rf /var/lib/mysql_tmpfs/api*
rm -rf /dev/shm/api*
# Configure the new datadir
echo -e "[mysqld]\ndatadir = /var/lib/mysql_tmpfs" > /etc/my.cnf.d/obs.cnf
echo -e "[mysqld]\ndatadir = /dev/shm" > /etc/my.cnf.d/obs.cnf
/usr/lib/mysql/mysql-systemd-helper start
7 changes: 1 addition & 6 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ services:
db:
image: registry.opensuse.org/obs/server/unstable/container/sle12/sp3/images/openbuildservice/mariadb:latest
volumes:
- mysql_vol:/var/lib/mysql_tmpfs/
- .:/obs
shm_size: 512MB
command: /obs/contrib/start_test_db
backend:
image: registry.opensuse.org/obs/server/unstable/container/sle12/sp3/images/openbuildservice/backend:latest
volumes:
- .:/obs
working_dir: /obs
command: make -C src/backend test
volumes:
mysql_vol:
driver_opts:
type: tmpfs
device: tmpfs

0 comments on commit 3bf1363

Please sign in to comment.