66 branches : [master]
77
88jobs :
9- build :
9+ test-default-dump-path :
1010 runs-on : ubuntu-latest
1111 strategy :
1212 matrix :
13- python-version : [3.9]
14-
13+ python-version : [3.6, 3.7, 3.8, 3.9]
1514 steps :
1615 - uses : actions/checkout@v2
1716 - name : Set up Python ${{ matrix.python-version }}
@@ -21,26 +20,132 @@ jobs:
2120 - name : Set up DynamoDB Local
2221 run : |
2322 mkdir /tmp/dynamodb_local
24- wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb_local
25- java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar -sharedDb -inMemory &
23+ wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \
24+ | tar xz --directory /tmp/dynamodb_local
25+ java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \
26+ -sharedDb -inMemory &
2627 - name : Install dependencies
2728 run : |
2829 pip install -r requirements.txt
2930 - name : Test basic restore and backup
3031 run : |
3132 mkdir dump && cp -a tests/testTable dump
32- python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
33- python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 --accessKey a --secretKey a
33+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \
34+ --host localhost --port 8000 --accessKey a --secretKey a
35+ python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \
36+ --accessKey a --secretKey a
3437 python tests/test.py
3538 - name : Test wildcard restore and backup
3639 run : |
37- python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
40+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \
41+ --accessKey a --secretKey a
3842 rm -rf dump/test*
39- python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a --secretKey a
43+ python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \
44+ --secretKey a
4045 python tests/test.py
4146 - name : Test prefixed wildcard restore and backup
4247 run : |
43- python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
48+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \
49+ --accessKey a --secretKey a --prefixSeparator ""
4450 rm -rf dump/test*
45- python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a --secretKey a --prefixSeparator ""
51+ python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \
52+ --secretKey a --prefixSeparator ""
4653 python tests/test.py
54+
55+ test-non-default-dump-path :
56+ runs-on : ubuntu-latest
57+ strategy :
58+ matrix :
59+ python-version : [3.6, 3.7, 3.8, 3.9]
60+ env :
61+ DUMP_PATH : abc
62+ steps :
63+ - uses : actions/checkout@v2
64+ - name : Set up Python ${{ matrix.python-version }}
65+ uses : actions/setup-python@v2
66+ with :
67+ python-version : ${{ matrix.python-version }}
68+ - name : Set up DynamoDB Local
69+ run : |
70+ mkdir /tmp/dynamodb_local
71+ wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \
72+ | tar xz --directory /tmp/dynamodb_local
73+ java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \
74+ -sharedDb -inMemory &
75+ - name : Install dependencies
76+ run : |
77+ pip install -r requirements.txt
78+ - name : Test non default dump path basic restore and backup
79+ run : |
80+ mkdir ${{ env.DUMP_PATH }} && cp -a tests/testTable ${{ env.DUMP_PATH }}
81+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \
82+ --host localhost --port 8000 --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
83+ rm -rf ${{ env.DUMP_PATH }}
84+ python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \
85+ --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
86+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
87+ - name : Test non default dump path wildcard restore and backup
88+ run : |
89+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \
90+ --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
91+ rm -rf ${{ env.DUMP_PATH }}/test*
92+ python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \
93+ --secretKey a --dumpPath ${{ env.DUMP_PATH }}
94+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
95+ - name : Test non default dump path prefixed wildcard restore and backup
96+ run : |
97+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \
98+ --accessKey a --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }}
99+ rm -rf ${{ env.DUMP_PATH }}/test*
100+ python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \
101+ --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }}
102+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
103+
104+ test-absolute-dump-path :
105+ runs-on : ubuntu-latest
106+ strategy :
107+ matrix :
108+ python-version : [3.6, 3.7, 3.8, 3.9]
109+ env :
110+ DUMP_PATH : /tmp/abs
111+ steps :
112+ - uses : actions/checkout@v2
113+ - name : Set up Python ${{ matrix.python-version }}
114+ uses : actions/setup-python@v2
115+ with :
116+ python-version : ${{ matrix.python-version }}
117+ - name : Set up DynamoDB Local
118+ run : |
119+ mkdir /tmp/dynamodb_local
120+ wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \
121+ | tar xz --directory /tmp/dynamodb_local
122+ java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \
123+ -sharedDb -inMemory &
124+ - name : Install dependencies
125+ run : |
126+ pip install -r requirements.txt
127+ - name : Test absolute dump path basic restore and backup
128+ run : |
129+ mkdir ${{ env.DUMP_PATH }} && cp -a tests/testTable ${{ env.DUMP_PATH }}
130+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \
131+ --host localhost --port 8000 --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
132+ rm -rf ${{ env.DUMP_PATH }}
133+ python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \
134+ --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
135+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
136+ - name : Test absolute dump path wildcard restore and backup
137+ run : |
138+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \
139+ --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }}
140+ rm -rf ${{ env.DUMP_PATH }}/test*
141+ python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \
142+ --secretKey a --dumpPath ${{ env.DUMP_PATH }}
143+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
144+ - name : Test absolute dump path prefixed wildcard restore and backup
145+ run : |
146+ python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \
147+ --accessKey a --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }}
148+ rm -rf ${{ env.DUMP_PATH }}/test*
149+ python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \
150+ --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }}
151+ DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py
0 commit comments