|
12 | 12 | import pytest |
13 | 13 |
|
14 | 14 |
|
15 | | -@pytest.mark.skipif( |
16 | | - 'AWS_ACCESS_KEY_ID' not in os.environ, |
17 | | - reason="Snowflake admin account is not accessible." |
18 | | -) |
19 | 15 | def test_put_get_small_data_via_user_stage( |
20 | | - tmpdir, test_files, conn_cnx, db_parameters): |
| 16 | + is_public_test, tmpdir, test_files, conn_cnx, db_parameters): |
21 | 17 | """ |
22 | 18 | [s3] Put and Get Small Data via User Stage |
23 | 19 | """ |
| 20 | + if is_public_test or 'AWS_ACCESS_KEY_ID' not in os.environ: |
| 21 | + pytest.skip('This test requires to change the internal parameter') |
24 | 22 | _put_get_user_stage(tmpdir, test_files, conn_cnx, db_parameters, |
25 | 23 | number_of_files=5, number_of_lines=10) |
26 | 24 |
|
27 | 25 |
|
28 | | -@pytest.mark.skipif( |
29 | | - 'AWS_ACCESS_KEY_ID' not in os.environ, |
30 | | - reason="Snowflake admin account is not accessible." |
31 | | -) |
32 | | -def test_put_get_large_data_via_user_stage(tmpdir, test_files, conn_cnx, |
33 | | - db_parameters): |
| 26 | +def test_put_get_large_data_via_user_stage( |
| 27 | + is_public_test, tmpdir, test_files, conn_cnx, db_parameters): |
34 | 28 | """ |
35 | 29 | [s3] Put and Get Large Data via User Stage |
36 | 30 | """ |
| 31 | + if is_public_test or 'AWS_ACCESS_KEY_ID' not in os.environ: |
| 32 | + pytest.skip('This test requires to change the internal parameter') |
37 | 33 | _put_get_user_stage(tmpdir, test_files, conn_cnx, db_parameters, |
38 | 34 | number_of_files=2, |
39 | 35 | number_of_lines=200000) |
@@ -142,17 +138,16 @@ def _put_get_user_stage(tmpdir, test_files, conn_cnx, db_parameters, |
142 | 138 | name=db_parameters['name'])) |
143 | 139 |
|
144 | 140 |
|
145 | | -@pytest.mark.skipif( |
146 | | - 'AWS_ACCESS_KEY_ID' not in os.environ, |
147 | | - reason="Snowflake admin account is not accessible." |
148 | | -) |
149 | | -def test_put_get_duplicated_data_user_stage(tmpdir, test_files, conn_cnx, |
| 141 | +def test_put_get_duplicated_data_user_stage(is_public_test, tmpdir, test_files, conn_cnx, |
150 | 142 | db_parameters, |
151 | 143 | number_of_files=5, |
152 | 144 | number_of_lines=100): |
153 | 145 | """ |
154 | 146 | [s3] Put and Get Duplicated Data using User Stage |
155 | 147 | """ |
| 148 | + if is_public_test or 'AWS_ACCESS_KEY_ID' not in os.environ: |
| 149 | + pytest.skip('This test requires to change the internal parameter') |
| 150 | + |
156 | 151 | logger = getLogger(__name__) |
157 | 152 | assert 'AWS_ACCESS_KEY_ID' in os.environ, 'AWS_ACCESS_KEY_ID is missing' |
158 | 153 | assert 'AWS_SECRET_ACCESS_KEY' in os.environ, \ |
@@ -302,17 +297,12 @@ def test_put_get_duplicated_data_user_stage(tmpdir, test_files, conn_cnx, |
302 | 297 | name=db_parameters['name'])) |
303 | 298 |
|
304 | 299 |
|
305 | | -@pytest.mark.skipif( |
306 | | - 'AWS_ACCESS_KEY_ID' not in os.environ, |
307 | | - reason="Snowflake admin account is not accessible." |
308 | | -) |
309 | | -def test_get_data_user_stage(tmpdir, conn_cnx, db_parameters): |
| 300 | +def test_get_data_user_stage(is_public_test, tmpdir, conn_cnx, db_parameters): |
310 | 301 | """ |
311 | 302 | SNOW-20927: get failed with 404 error |
312 | 303 | """ |
313 | | - assert 'AWS_ACCESS_KEY_ID' in os.environ, 'AWS_ACCESS_KEY_ID is missing' |
314 | | - assert 'AWS_SECRET_ACCESS_KEY' in os.environ, \ |
315 | | - 'AWS_SECRET_ACCESS_KEY is missing' |
| 304 | + if is_public_test or 'AWS_ACCESS_KEY_ID' not in os.environ: |
| 305 | + pytest.skip('This test requires to change the internal parameter') |
316 | 306 |
|
317 | 307 | default_s3bucket = os.getenv('SF_AWS_USER_BUCKET', |
318 | 308 | "sfc-dev1-regression/{0}/reg".format( |
|
0 commit comments