3
3
## Required environment variables
4
4
5
5
To successfully import the catalog data for tests, the following environment variables should be set:
6
- - PROJECT_NUMBER
6
+ - GOOGLE_CLOUD_PROJECT_NUMBER
7
+ - GOOGLE_CLOUD_PROJECT_ID
7
8
- BUCKET_NAME
9
+ - EVENTS_BUCKET_NAME
8
10
These values are stored in the Secret Manager and will be submitted as
9
11
docker environment variables before the test run.
10
12
11
13
The Secret Manager name is set in .kokoro/presubmit/common.cfg file, SECRET_MANAGER_KEYS variable.
12
14
13
15
## Import catalog data
14
16
15
- There is a JSON file with valid products prepared in the ` product ` directory:
16
- ` resources/products.json ` .
17
+ There are JSON files with valid products and user events prepared in ` resources ` directory:
18
+ ` samples/ resources/products.json` and ` samples/resources/user_events.json ` respectively .
17
19
18
20
Run the ` create_test_resources.py ` to perform the following actions:
19
21
- create the GCS bucket <BUCKET_NAME>,
20
- - upload the product data from ` resources/products.json ` file,
21
- - import products to the default branch of the Retail catalog.
22
+ - upload the product data from ` resources/products.json ` file to products bucket,
23
+ - import products to the default branch of the Retail catalog,
24
+ - create the GCS bucket <EVENTS_BUCKET_NAME>,
25
+ - upload the product data from ` resources/user_events.json ` file to events bucket,
26
+ - create a BigQuery dataset and table ` products ` ,
27
+ - insert products from resources/products.json to the created products table,
28
+ - create a BigQuery dataset and table ` events ` ,
29
+ - insert user events from resources/user_events.json to the created events table
30
+
22
31
23
32
```
24
33
$ python create_test_resources.py
@@ -33,6 +42,10 @@ Run the `remove_test_resources.py` to perform the following actions:
33
42
- remove all objects from the GCS bucket <BUCKET_NAME>,
34
43
- remove the <BUCKET_NAME> bucket,
35
44
- delete all products from the Retail catalog.
45
+ - remove all objects from the GCS bucket <EVENTS_BUCKET_NAME>,
46
+ - remove the <EVENTS_BUCKET_NAME> bucket,
47
+ - remove dataset ` products ` along with tables
48
+ - remove dataset ` user_events ` along with tables
36
49
37
50
```
38
51
$ python remove_test_resources.py
0 commit comments