-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (128 loc) · 4.74 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Run automated tests
on:
push:
branches:
- master
pull_request:
branches:
- master
- support/**
types: [opened, synchronize]
paths-ignore:
- '**/*.md'
release:
types:
- published
workflow_dispatch:
env:
TESTS_DATA_DIR: './tests/data'
permissions: write-all
jobs:
run_system_tests:
runs-on: ubuntu-latest
timeout-minutes: 500
steps:
- name: Get the current date
id: date
shell: bash
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- name: Set url prefix
shell: bash
env:
TIMESTAMP: ${{ steps.date.outputs.timestamp }}
run: |
echo "URL_PREFIX=${{ github.run_number }}-$TIMESTAMP" >> $GITHUB_ENV
- name: Set attributes
shell: bash
env:
TIMESTAMP: ${{ steps.date.outputs.timestamp }}
run: |
echo "NEOFS_ATTRIBUTES=RunNumber=${{ github.run_number }}-$TIMESTAMP,Type=action_test_files" >> $GITHUB_ENV
- name: Checkout gh-push-to-neofs
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11.6'
- run: python --version
- name: Prepare venv
shell: bash
id: prepare_venv
run: |
python3 -m venv venv
source venv/bin/activate && pip install -r requirements.txt
working-directory: ./tests
- name: Run gh-push-to-neofs with url prefix
id: gh_push_to_neofs_with_url_prefix
uses: ./
with:
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
LIFETIME: ${{ vars.LIFETIME }}
PATH_TO_FILES_DIR: ${{ env.TESTS_DATA_DIR }}
NEOFS_ATTRIBUTES: ${{ env.NEOFS_ATTRIBUTES }}
URL_PREFIX: ${{ env.URL_PREFIX }}
- name: Run tests
env:
OUTPUT_CONTAINER_URL: ${{ steps.gh_push_to_neofs_with_url_prefix.outputs.OUTPUT_CONTAINER_URL }}
run: |
source venv/bin/activate && pytest test_downloads.py --base_url="$OUTPUT_CONTAINER_URL"
working-directory: ./tests
- name: Run gh-push-to-neofs without attributes
id: gh_push_to_neofs_without_attributes
uses: ./
with:
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
LIFETIME: ${{ vars.LIFETIME }}
PATH_TO_FILES_DIR: ${{ env.TESTS_DATA_DIR }}
URL_PREFIX: ${{ env.URL_PREFIX }}
- name: Run tests
env:
OUTPUT_CONTAINER_URL: ${{ steps.gh_push_to_neofs_with_url_prefix.outputs.OUTPUT_CONTAINER_URL }}
run: |
source venv/bin/activate && pytest test_downloads.py --base_url="$OUTPUT_CONTAINER_URL"
working-directory: ./tests
- name: Prepare directory name for tests without url prefix
shell: bash
env:
TIMESTAMP: ${{ steps.date.outputs.timestamp }}
run: |
echo "PREFIX_DIR=${{ github.run_number }}-$TIMESTAMP-$(uuidgen)" >> $GITHUB_ENV
- name: Create a directory tree for tests with url prefix
shell: bash
run: |
mkdir "$PREFIX_DIR"
- name: Move files to the directory tree for tests with url prefix
shell: bash
env:
SOURCE_DIR: ${{ env.TESTS_DATA_DIR }}
DEST_DIR: ${{ env.PREFIX_DIR }}
run: |
rsync -av "$SOURCE_DIR" "$DEST_DIR"
- name: Run gh-push-to-neofs without url prefix
id: gh_push_to_neofs_without_url_prefix
uses: ./
with:
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
LIFETIME: ${{ vars.LIFETIME }}
PATH_TO_FILES_DIR: ${{ env.PREFIX_DIR }}
NEOFS_ATTRIBUTES: ${{ env.NEOFS_ATTRIBUTES }}
- name: Run tests
env:
OUTPUT_CONTAINER_URL: ${{ steps.gh_push_to_neofs_without_url_prefix.outputs.OUTPUT_CONTAINER_URL }}
REPORT_DIR: ${{ env.PREFIX_DIR }}
run: |
source venv/bin/activate && pytest test_downloads.py --base_url="$OUTPUT_CONTAINER_URL" --report_dir="$REPORT_DIR"
working-directory: ./tests