chore(deps): update pre-commit hook psf/black-pre-commit-mirror to v2… #943
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
pull_request: | |
branches: [master] | |
jobs: | |
test-default-dump-path: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up DynamoDB Local | |
run: | | |
mkdir /tmp/dynamodb_local | |
wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \ | |
| tar xz --directory /tmp/dynamodb_local | |
java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \ | |
-sharedDb -inMemory & | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test basic restore and backup | |
run: | | |
mkdir dump && cp -a tests/testTable dump | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \ | |
--host localhost --port 8000 --accessKey a --secretKey a | |
python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \ | |
--accessKey a --secretKey a | |
python tests/test.py | |
- name: Test wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a | |
rm -rf dump/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a | |
python tests/test.py | |
- name: Test prefixed wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a --prefixSeparator "" | |
rm -rf dump/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a --prefixSeparator "" | |
python tests/test.py | |
test-non-default-dump-path: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
env: | |
DUMP_PATH: abc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up DynamoDB Local | |
run: | | |
mkdir /tmp/dynamodb_local | |
wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \ | |
| tar xz --directory /tmp/dynamodb_local | |
java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \ | |
-sharedDb -inMemory & | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test non default dump path basic restore and backup | |
run: | | |
mkdir ${{ env.DUMP_PATH }} && cp -a tests/testTable ${{ env.DUMP_PATH }} | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \ | |
--host localhost --port 8000 --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }} | |
python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \ | |
--accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py | |
- name: Test non default dump path wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }}/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py | |
- name: Test non default dump path prefixed wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }}/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py | |
test-absolute-dump-path: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
env: | |
DUMP_PATH: /tmp/abs | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up DynamoDB Local | |
run: | | |
mkdir /tmp/dynamodb_local | |
wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz \ | |
| tar xz --directory /tmp/dynamodb_local | |
java -Djava.library.path=/tmp/dynamodb_local/DynamoDBLocal_lib -jar /tmp/dynamodb_local/DynamoDBLocal.jar \ | |
-sharedDb -inMemory & | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
- name: Test absolute dump path basic restore and backup | |
run: | | |
mkdir ${{ env.DUMP_PATH }} && cp -a tests/testTable ${{ env.DUMP_PATH }} | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s testTable -d testRestoredTable \ | |
--host localhost --port 8000 --accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }} | |
python dynamodump/dynamodump.py -m backup -r local -s testRestoredTable --host localhost --port 8000 \ | |
--accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py | |
- name: Test absolute dump path wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }}/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py | |
- name: Test absolute dump path prefixed wildcard restore and backup | |
run: | | |
python dynamodump/dynamodump.py -m restore --noConfirm -r local -s "test*" --host localhost --port 8000 \ | |
--accessKey a --secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }} | |
rm -rf ${{ env.DUMP_PATH }}/test* | |
python dynamodump/dynamodump.py -m backup -r local -s "test*" --host localhost --port 8000 --accessKey a \ | |
--secretKey a --prefixSeparator "" --dumpPath ${{ env.DUMP_PATH }} | |
DUMP_DATA_DIR=${{ env.DUMP_PATH }} python tests/test.py |