Skip to content

Commit 1c4ffac

Browse files
author
arthosofteq
authored
Merge pull request #119 from RedisInsight/feature/RI-2088_get_rid_of_python_scripts
#RI-2088 remove python scripts with plain curl commands on test datab…
2 parents 352874b + f90f106 commit 1c4ffac

File tree

21 files changed

+65
-845
lines changed

21 files changed

+65
-845
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'javascript', 'python' ]
35+
language: [ 'javascript' ]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3737
# Learn more about CodeQL language support at https://git.io/codeql-language-support
3838

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
FROM redislabs/redis:6.0.8-28.bionic
1+
FROM redislabs/redis:6.2.8-50
22

3-
# Change user to root to install pip
4-
USER root
5-
RUN set -ex \
6-
&& apt-get update \
7-
&& apt-get install -y python3-pip \
8-
&& pip3 install requests
9-
# Change user back to redislabs
10-
USER redislabs
11-
12-
# Set the env var to instruct RE to create a cluster on startup
3+
## Set the env var to instruct RE to create a cluster on startup
134
ENV BOOTSTRAP_ACTION create_cluster
145
ENV BOOTSTRAP_CLUSTER_FQDN cluster.local
156

16-
COPY run_re_and_create_db.sh create_dbs.py cert.pem ./
7+
COPY entrypoint.sh db.json ./
178

18-
ENTRYPOINT [ "bash", "./run_re_and_create_db.sh" ]
9+
ENTRYPOINT [ "bash", "./entrypoint.sh" ]

redisinsight/api/test/test-runs/re-clu/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

redisinsight/api/test/test-runs/re-clu/cert.pem

Lines changed: 0 additions & 32 deletions
This file was deleted.

redisinsight/api/test/test-runs/re-clu/create_dbs.py

Lines changed: 0 additions & 218 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "testdb",
3+
"type": "redis",
4+
"memory_size": 1073741824,
5+
"port": 12010,
6+
"sharding": true,
7+
"shards_count": 3,
8+
"proxy_policy": "all-master-shards",
9+
"oss_cluster": true,
10+
"shard_key_regex": [
11+
{
12+
"regex": ".*\\{(?<tag>.*)\\}.*"
13+
},
14+
{
15+
"regex": "(?<tag>.*)"
16+
}
17+
]
18+
}

redisinsight/api/test/test-runs/re-clu/docker-compose.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,5 @@ services:
99
build: ./re-clu
1010
cap_add:
1111
- sys_resource
12-
environment:
13-
- CREATE_CLUSTER_DB=1
14-
# ports:
15-
# - 12010:12010
16-
# - 8443:8443
17-
# - 9443:9443
12+
env_file:
13+
- ./re-clu/.env

tests/e2e/rte/redis-enterprise/run_re_and_create_db.sh renamed to redisinsight/api/test/test-runs/re-clu/entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#! /bin/bash
22

3+
TEST_RE_USER=${TEST_RE_USER:-"[email protected]"}
4+
TEST_RE_PASS=${TEST_RE_PASS:-"123456"}
5+
36
set -e
47

58
# enable job control
@@ -8,7 +11,7 @@ set -m
811
/opt/start.sh &
912

1013
# This command queries the REST API and outputs the status code
11-
CURL_CMD="curl --silent --fail --output /dev/null -i -w %{http_code} -u [email protected]:123456 -k https://redis-enterprise:9443/v1/nodes"
14+
CURL_CMD="curl --silent --fail --output /dev/null -i -w %{http_code} -u $TEST_RE_USER:$TEST_RE_PASS -k https://localhost:9443/v1/nodes"
1215

1316
# Wait to get 2 consecutive 200 responses from the REST API
1417
while true
@@ -30,9 +33,9 @@ do
3033
fi
3134
done
3235

33-
echo "Running Python script to create databases..."
34-
python3 create_dbs.py
36+
echo "Creating databases..."
3537

38+
curl -k -u "$TEST_RE_USER:$TEST_RE_PASS" --request POST --url "https://localhost:9443/v1/bdbs" --header 'content-type: application/json' --data-binary "@db.json"
3639

3740
# now we bring the primary process back into the foreground
3841
# and leave it there
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
FROM redislabs/redis:6.0.8-28.bionic
1+
FROM redislabs/redis:6.2.8-50
22

3-
# Change user to root to install pip
4-
USER root
5-
RUN set -ex \
6-
&& apt-get update \
7-
&& apt-get install -y python3-pip \
8-
&& pip3 install requests
9-
# Change user back to redislabs
10-
USER redislabs
11-
12-
# Set the env var to instruct RE to create a cluster on startup
3+
## Set the env var to instruct RE to create a cluster on startup
134
ENV BOOTSTRAP_ACTION create_cluster
145
ENV BOOTSTRAP_CLUSTER_FQDN cluster.local
156

16-
COPY run_re_and_create_db.sh create_dbs.py cert.pem ./
7+
COPY entrypoint.sh db.json ./
178

18-
ENTRYPOINT [ "bash", "./run_re_and_create_db.sh" ]
9+
ENTRYPOINT [ "bash", "./entrypoint.sh" ]

0 commit comments

Comments
 (0)