Skip to content

Commit

Permalink
Merge pull request #408 from twindb/int-tests
Browse files Browse the repository at this point in the history
Fix integration tests jammy, focal
  • Loading branch information
akuzminsky authored Aug 31, 2023
2 parents c44ac84 + d29522b commit 127f446
Show file tree
Hide file tree
Showing 23 changed files with 30 additions and 293 deletions.
31 changes: 1 addition & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ help:

.PHONY: virtualenv
virtualenv: ## create virtual environment typically used for development purposes
virtualenv -p python3.9 --always-copy --prompt='(twindb_backup)' ~/.virtualenvs/twindb-backup/
virtualenv -p python3 --always-copy --prompt='(twindb_backup)' ~/.virtualenvs/twindb-backup/
@printf "To activate run:\n\n. ~/.virtualenvs/twindb-backup/bin/activate\n\n"

.PHONY: pip
Expand Down Expand Up @@ -94,9 +94,6 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/
rm -rf .pytest_cache

clean-docker:
@sudo docker rm twindb-backup-build-${PLATFORM}


clean-docs:
rm -rf docs/_build
Expand Down Expand Up @@ -129,9 +126,6 @@ test-including-azure-blob: ## Like 'make test' but includes tests for azure blob
test-integration: ## Run integration tests. Must be run in vagrant
py.test -xsv tests/integration/

coverage: ## check code coverage quickly with the default Python
py.test --cov-report term-missing --cov=twindb_backup tests/unit

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/twindb_backup.rst
# rm -f docs/modules.rst
Expand All @@ -155,25 +149,6 @@ install: clean ## install the package to the active Python's site-packages
install -m 600 -o root support/twindb-backup.cfg "${DESTDIR}/etc/twindb" ; \
fi

docker-test: ## Test twindb-backup in a docker container
@sudo docker run \
-v `pwd`:/twindb-backup:rw \
-e "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" \
-e "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" \
-e "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" \
-e "GC_CREDENTIALS_FILE=${GC_CREDENTIALS_FILE}" \
-e "OS_VERSION"=${OS_VERSION} \
-e "CI"=${CI} \
-e "TRAVIS"=${TRAVIS} \
-e "TRAVIS_BRANCH"=${TRAVIS_BRANCH} \
-e "TRAVIS_COMMIT"=${TRAVIS_COMMIT} \
-e "TRAVIS_JOB_NUMBER"=${TRAVIS_JOB_NUMBER} \
-e "TRAVIS_PULL_REQUEST"=${TRAVIS_PULL_REQUEST} \
-e "TRAVIS_JOB_ID"=${TRAVIS_JOB_ID} \
-e "TRAVIS_REPO_SLUG"=${TRAVIS_REPO_SLUG} \
-e "TRAVIS_TAG"=${TRAVIS_TAG} \
${DOCKER_IMAGE} /bin/bash /twindb-backup/support/docker-test-${PLATFORM}.sh

.PHONY: docker-start
docker-start: ## Start a container with /twindb-backup for debugging packaging, etc.
@docker run \
Expand All @@ -182,8 +157,6 @@ docker-start: ## Start a container with /twindb-backup for debugging packaging,
-it \
--name builder_xtrabackup \
--rm \
--dns 8.8.8.8 \
--dns 208.67.222.222 \
--env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
--env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
--env "GC_CREDENTIALS_FILE=${GC_CREDENTIALS_FILE}" \
Expand All @@ -203,8 +176,6 @@ package: ## Build package - OS_VERSION must be one of: jammy, focal.
-v ${pwd}:/twindb-backup \
--name builder_xtrabackup \
--rm \
--dns 8.8.8.8 \
--dns 208.67.222.222 \
--env AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} \
--env AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} \
--env PLATFORM=${PLATFORM} \
Expand Down
2 changes: 1 addition & 1 deletion omnibus/config/projects/twindb-backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# and /opt/twindb-backup on all other platforms
install_dir '/opt/twindb-backup'

build_version '3.2.0'
build_version '3.2.1'

build_iteration 1

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.2.0
current_version = 3.2.1
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

setup(
name="twindb-backup",
version="3.2.0",
version="3.2.1",
description="TwinDB Backup tool for files, MySQL et al.",
long_description=readme + "\n\n" + history,
author="TwinDB Development Team",
Expand Down
28 changes: 0 additions & 28 deletions support/bootstrap/master/centos/master1.sh

This file was deleted.

25 changes: 0 additions & 25 deletions support/bootstrap/master/centos/slave.sh

This file was deleted.

25 changes: 0 additions & 25 deletions support/bootstrap/master/debian/master1.sh

This file was deleted.

26 changes: 0 additions & 26 deletions support/bootstrap/master/debian/slave.sh

This file was deleted.

2 changes: 2 additions & 0 deletions support/bootstrap/master/ubuntu/master1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package="/twindb-backup/omnibus/pkg/twindb-backup_${TB_VERSION}-1_amd64.deb"

apt -y install "$package"

chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf

set +u
if ! test -z "${DEV}"; then
/bin/cp -R /twindb-backup/twindb_backup /opt/twindb-backup/embedded/lib/python3.9/site-packages
Expand Down
2 changes: 2 additions & 0 deletions support/bootstrap/master/ubuntu/slave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ apt -y install "$package"
rm -rf /var/lib/mysql
mkdir /var/lib/mysql

chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf

set +u
if ! test -z "${DEV}"; then
/bin/cp -R /twindb-backup/twindb_backup /opt/twindb-backup/embedded/lib/python3.9/site-packages
Expand Down
43 changes: 0 additions & 43 deletions support/docker-test-centos.sh

This file was deleted.

40 changes: 0 additions & 40 deletions support/docker-test-debian.sh

This file was deleted.

40 changes: 0 additions & 40 deletions support/docker-test-ubuntu.sh

This file was deleted.

6 changes: 2 additions & 4 deletions tests/integration/backup/s3/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ def test_take_mysql_backup_aenc_restores_full(
files_to_test = []
mysql_files = [
"ibdata1",
"ib_logfile0",
"backup-my.cnf",
]
for datadir_file in mysql_files:
Expand All @@ -596,7 +595,7 @@ def test_take_mysql_backup_aenc_restores_full(
docker_client,
master1["Id"],
dst_dir,
["ib_logfile1", "xtrabackup_logfile"],
["xtrabackup_logfile"],
)
check_either_file(
docker_client,
Expand Down Expand Up @@ -733,7 +732,6 @@ def test_take_mysql_backup_aenc_restores_inc(

for datadir_file in [
"ibdata1",
"ib_logfile0",
"backup-my.cnf",
]:
cmd = ["bash", "-c", f"test -f {osp.join(dst_dir, datadir_file)}"]
Expand All @@ -747,7 +745,7 @@ def test_take_mysql_backup_aenc_restores_inc(
docker_client,
master1["Id"],
dst_dir,
["ib_logfile1", "xtrabackup_logfile"],
["xtrabackup_logfile"],
)

check_either_file(
Expand Down
Loading

0 comments on commit 127f446

Please sign in to comment.