Skip to content

Commit

Permalink
Acra v0.90.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Lagovas committed Nov 5, 2021
1 parent 5c9c61c commit 88e2c59
Show file tree
Hide file tree
Showing 344 changed files with 40,462 additions and 7,774 deletions.
2 changes: 1 addition & 1 deletion .circleci/check_golint.sh
Expand Up @@ -7,7 +7,7 @@
# and skip issues about `_` in packages' names since we won't rename packages just to make this issue disappear
result=$(golint ./... | grep -v "\.pb\.go\|don't use an underscore in package name" | tee /dev/stderr | wc -l)

if [[ $result -gt 13 ]]; then
if [[ $result -gt 4 ]]; then
# too many golint issues
echo "Too many golint issues: $result"
exit 1;
Expand Down
158 changes: 144 additions & 14 deletions .circleci/config.yml
Expand Up @@ -5,7 +5,7 @@ jobs:
- image: cossacklabs/ci-py-go-themis:latest
environment:
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.13.15 1.14.9 1.15.2
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_DB_PORT: "5432"
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "on"
Expand All @@ -21,6 +21,9 @@ jobs:
- run: .circleci/check_gotest.sh
# check python wrapper
- run: PYTHONPATH=`pwd`/wrappers/python python3 wrappers/python/acrawriter/tests.py

- store_test_results:
path: /home/user/tests_output
- store_artifacts:
path: /home/user/tests_output

Expand All @@ -38,7 +41,7 @@ jobs:
TEST_DB_NAME: test
TEST_DB_PORT: "5432"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.13.15 1.14.9 1.15.2
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "on"
steps:
Expand Down Expand Up @@ -84,7 +87,7 @@ jobs:
TEST_DB_NAME: test
TEST_DB_PORT: "5432"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.13.15 1.14.9 1.15.2
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "off"
steps:
Expand Down Expand Up @@ -116,24 +119,128 @@ jobs:
- store_artifacts:
path: /home/user/tests_output

postgresql-vault:
docker:
- image: cossacklabs/ci-py-go-themis:latest
- image: postgres:11-alpine
environment:
POSTGRES_PASSWORD: test
POSTGRES_USER: test
POSTGRES_DB: test
- image: vault:1.6.2
environment:
VAULT_LOCAL_CONFIG: '{"listener":[{"tcp": {"address": "0.0.0.0:8201","tls_disable": "1"}}],"ui":true,"storage":{"file":{"path":"/vault/data"}}}'
VAULT_TOKEN: 'root_token'
command: server -dev -dev-root-token-id="root_token"
environment:
TEST_DB_USER: test
TEST_DB_USER_PASSWORD: test
TEST_DB_NAME: test
TEST_DB_PORT: "5432"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "off"
TEST_WITH_VAULT: "on"
VAULT_API_TOKEN: cm9vdF90b2tlbgo= # base64 of the root_token
TEST_POSTGRESQL: "off"
TEST_NAME_PATTERN: "VaultMasterKeyLoader"
steps:
# prepare
- checkout
# database in neighbor container need some time to start
# wait for the DB to be reachable, up to 15 pings with 1 second interval
- run: NUM_PINGS=15 DELAY=1 .circleci/check_postgresql_connection.sh
# each iteration pass to test different ports for forks to avoid problems with TCP TIME WAIT between tests
- run:
name: Integration tests (kv secret_engine v1)
command: |
.circleci/integration.sh
if [ -f $FILEPATH_ERROR_FLAG ]; then cat "$FILEPATH_ERROR_FLAG"; rm "$FILEPATH_ERROR_FLAG"; exit 1; fi
- run:
name: Integration tests (kv secret_engine v2)
environment:
VAULT_KV_ENGINE_VERSION: v2
command: |
.circleci/integration.sh
if [ -f $FILEPATH_ERROR_FLAG ]; then cat "$FILEPATH_ERROR_FLAG"; rm "$FILEPATH_ERROR_FLAG"; exit 1; fi
- store_test_results:
path: /home/user/tests_output
- store_artifacts:
path: /home/user/tests_output


postgresql-vault-ssl:
docker:
- image: cossacklabs/ci-py-go-themis:latest
- image: postgres:11-alpine
environment:
POSTGRES_PASSWORD: test
POSTGRES_USER: test
POSTGRES_DB: test
- image: cossacklabs/vault-ssl:1.6.2
environment:
VAULT_LOCAL_CONFIG: '{"listener": [{"tcp":{"address": "0.0.0.0:8201","tls_disable":"0", "tls_cert_file":"/data/vault-volume/vault_crt.pem", "tls_key_file":"/data/vault-volume/vault_key.pem"}}], "default_lease_ttl": "168h", "max_lease_ttl": "720h"}, "ui": true, "storage":{"file":{"path":"/vault/data"}}}'
VAULT_TOKEN: 'root_token'
command: server -dev -dev-root-token-id="root_token"
environment:
TEST_DB_USER: test
TEST_DB_USER_PASSWORD: test
TEST_DB_NAME: test
TEST_DB_PORT: "5432"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "off"
TEST_WITH_VAULT: "on"
TEST_SSL_VAULT: "on"
VAULT_ADDRESS: https://localhost:8201/
VAULT_API_TOKEN: cm9vdF90b2tlbgo= # base64 of the root_token
TEST_POSTGRESQL: "off"
TEST_NAME_PATTERN: "VaultMasterKeyLoader"
steps:
# prepare
- checkout
# database in neighbor container need some time to start
# wait for the DB to be reachable, up to 15 pings with 1 second interval
- run: NUM_PINGS=15 DELAY=1 .circleci/check_postgresql_connection.sh
# each iteration pass to test different ports for forks to avoid problems with TCP TIME WAIT between tests
- run:
name: Integration tests (kv secret_engine v1)
command: |
.circleci/integration.sh
if [ -f $FILEPATH_ERROR_FLAG ]; then cat "$FILEPATH_ERROR_FLAG"; rm "$FILEPATH_ERROR_FLAG"; exit 1; fi
- run:
name: Integration tests (kv secret_engine v2)
environment:
VAULT_KV_ENGINE_VERSION: v2
command: |
.circleci/integration.sh
if [ -f $FILEPATH_ERROR_FLAG ]; then cat "$FILEPATH_ERROR_FLAG"; rm "$FILEPATH_ERROR_FLAG"; exit 1; fi
- store_test_results:
path: /home/user/tests_output
- store_artifacts:
path: /home/user/tests_output

mariadb-ssl:
docker:
- image: cossacklabs/ci-py-go-themis:latest
# use the same credentials for mysql db as for postgresql (which support was added first)
# has latest tag on 2018.03.29
- image: cossacklabs/mariadb-ssl:10.3-1
environment:
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: root
- image: cossacklabs/ci-py-go-themis:latest
# use the same credentials for mysql db as for postgresql (which support was added first)
# has latest tag on 2018.03.29
- image: cossacklabs/mariadb-ssl:10.3-1
environment:
MYSQL_DATABASE: test
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: root
environment:
TEST_DB_USER: test
TEST_DB_USER_PASSWORD: test
TEST_DB_NAME: test
TEST_DB_PORT: "3306"
FILEPATH_ERROR_FLAG: /tmp/test_fail
TEST_MYSQL: "true"
TEST_MARIADB: "true"
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "on"
steps:
Expand Down Expand Up @@ -182,8 +289,9 @@ jobs:
TEST_DB_NAME: test
TEST_DB_PORT: "3306"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.13.15 1.14.9 1.15.2
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_MYSQL: "true"
TEST_MARIADB: "true"
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "off"
steps:
Expand Down Expand Up @@ -279,7 +387,7 @@ jobs:
TEST_DB_NAME: test
TEST_DB_PORT: "3306"
FILEPATH_ERROR_FLAG: /tmp/test_fail
GO_VERSIONS: 1.13.15 1.14.9 1.15.2
GO_VERSIONS: 1.14.9 1.15.2 1.16.9
TEST_MYSQL: "true"
TEST_RANDOM_DATA_FOLDER: /tmp/test_data
TEST_TLS: "off"
Expand Down Expand Up @@ -312,6 +420,25 @@ jobs:
- store_artifacts:
path: /home/user/tests_output

build_image:
docker:
- image: cossacklabs/ci-py-go-themis:latest
steps:
# prepare
- checkout
# https://circleci.com/docs/2.0/building-docker-images/#docker-version
- setup_remote_docker:
version: 18.09.3
- run:
name: Install Docker client
command: |
set -x
VER="18.09.3"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
sudo mv /tmp/docker/* /usr/bin
- run: make docker-build

workflows:
version: 2
tests:
Expand All @@ -323,3 +450,6 @@ workflows:
- mysql-ssl
- mariadb
- mariadb-ssl
- build_image
- postgresql-vault
- postgresql-vault-ssl
7 changes: 6 additions & 1 deletion .circleci/integration.sh
Expand Up @@ -56,11 +56,16 @@ for go_version in $GO_VERSIONS; do

echo "-------------------- Testing with TEST_TLS=${TEST_TLS}"

run_test_cmd='timeout ${TEST_RUN_TIMEOUT} python3 tests/test.py -v | tee "${LOG_OUTPUT}";'
if [[ -n "${TEST_NAME_PATTERN}" ]]; then
run_test_cmd='timeout ${TEST_RUN_TIMEOUT} python3 tests/test.py -v -k "${TEST_NAME_PATTERN}" | tee "${LOG_OUTPUT}";'
fi

for iteration in {1..3}; do
context="${iteration}-golang-${go_version}-tls-${TEST_TLS}"
export TEST_XMLOUTPUT="${TEST_OUTPUT_FOLDER}/${context}.xml"
LOG_OUTPUT="${TEST_OUTPUT_FOLDER}/${context}.log"
timeout ${TEST_RUN_TIMEOUT} python3 tests/test.py -v | tee "${LOG_OUTPUT}";
eval $run_test_cmd
status="$?"
if [[ "${status}" != "0" ]]; then
echo "${context}. status=${status}" >> "$FILEPATH_ERROR_FLAG";
Expand Down

0 comments on commit 88e2c59

Please sign in to comment.