|
31 | 31 | ],
|
32 | 32 | },
|
33 | 33 | }
|
34 |
| - |
35 |
| - |
36 |
| -@pytest.fixture(autouse=True) |
37 |
| -def setup_and_teardown_cluster(): |
38 |
| - # Create cluster configuration |
39 |
| - cluster_data = { |
40 |
| - 'project_id': PROJECT, |
41 |
| - 'cluster_name': CLUSTER_NAME, |
42 |
| - 'config': { |
43 |
| - 'gce_cluster_config': { |
44 |
| - 'zone_uri': '', |
45 |
| - "metadata": { |
46 |
| - "PIP_PACKAGES": "google-cloud-storage" |
47 |
| - }, |
| 34 | +CLUSTER_DATA = { # Create cluster configuration |
| 35 | + 'project_id': PROJECT, |
| 36 | + 'cluster_name': CLUSTER_NAME, |
| 37 | + 'config': { |
| 38 | + 'gce_cluster_config': { |
| 39 | + 'zone_uri': '', |
| 40 | + "metadata": { |
| 41 | + "PIP_PACKAGES": "google-cloud-storage" |
48 | 42 | },
|
49 |
| - 'master_config': { |
50 |
| - 'num_instances': 1, |
51 |
| - 'machine_type_uri': 'n1-standard-8' |
52 |
| - }, |
53 |
| - 'worker_config': { |
54 |
| - 'num_instances': 6, |
55 |
| - 'machine_type_uri': 'n1-standard-8' |
56 |
| - }, |
57 |
| - "initialization_actions": [ |
58 |
| - { |
59 |
| - "executable_file": ("gs://dataproc-initialization-actions/" |
60 |
| - "python/pip-install.sh"), |
61 |
| - } |
62 |
| - ], |
63 |
| - "software_config": { |
64 |
| - "image_version": "1.5.4-debian10", |
65 |
| - "optional_components": [ |
66 |
| - "ANACONDA" |
67 |
| - ], |
| 43 | + }, |
| 44 | + 'master_config': { |
| 45 | + 'num_instances': 1, |
| 46 | + 'machine_type_uri': 'n1-standard-8' |
| 47 | + }, |
| 48 | + 'worker_config': { |
| 49 | + 'num_instances': 6, |
| 50 | + 'machine_type_uri': 'n1-standard-8' |
| 51 | + }, |
| 52 | + "initialization_actions": [ |
| 53 | + { |
| 54 | + "executable_file": ("gs://dataproc-initialization-actions/" |
| 55 | + "python/pip-install.sh"), |
68 | 56 | }
|
| 57 | + ], |
| 58 | + "software_config": { |
| 59 | + "image_version": "1.5.4-debian10", |
| 60 | + "optional_components": [ |
| 61 | + "ANACONDA" |
| 62 | + ], |
69 | 63 | }
|
70 | 64 | }
|
| 65 | +} |
71 | 66 |
|
| 67 | + |
| 68 | +@pytest.fixture(autouse=True) |
| 69 | +def setup_and_teardown_cluster(): |
72 | 70 | # Create cluster using cluster client
|
73 | 71 | cluster_client = dataproc.ClusterControllerClient(client_options={
|
74 | 72 | 'api_endpoint': f'{REGION}-dataproc.googleapis.com:443'
|
75 | 73 | })
|
76 |
| - operation = cluster_client.create_cluster(PROJECT, REGION, cluster_data) |
| 74 | + operation = cluster_client.create_cluster(PROJECT, REGION, CLUSTER_DATA) |
77 | 75 |
|
78 | 76 | # Wait for cluster to provision
|
79 | 77 | operation.result()
|
@@ -111,7 +109,7 @@ def get_blob_from_path(path):
|
111 | 109 |
|
112 | 110 |
|
113 | 111 | def is_in_table(value, out):
|
114 |
| - return re.search(f"\| *{value}\|", out) |
| 112 | + return re.search(f"\\| *{value}\\|", out) |
115 | 113 |
|
116 | 114 |
|
117 | 115 | def test_setup():
|
|
0 commit comments