You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- S3_ENDPOINT: endpoint of AWS S3 API, for unit and e2e test only; default to `localhost:9000`
70
+
71
+
## AWS S3 Setup
72
+
Go to https://console.aws.amazon.com/ and login. Choose S3 from Service folder and click `Create bucket`. Following the instruction to create S3 bucket.
73
+
74
+
## Local services setup
75
+
In the `local` folder, run `docker-compose up`
76
+
It starts Elasticsearch, DynamoDB and S3 compatible server.
77
+
78
+
## Mock api
79
+
For postman verification, please use the mock api under mock-api folder. It provides mock endpoint to fetch challenge resources and groups.
80
+
You need to ensure DynamoDB configuration in `mock-api/config/default.js` is consistent with `config/default.js`
81
+
Go to `mock-api` folder and run command `npm run start` to start the mock-api listening on port 4000
82
+
83
+
## Create Tables
33
84
1. Make sure DynamoDB are running as per instructions above.
85
+
2. Make sure you have configured all config parameters. Refer [Configuration](#configuration)
86
+
3. Run `npm run create-tables` to create tables.
34
87
35
-
2. Run the following commands
36
-
```
37
-
docker exec -ti dynamodb sh
38
-
```
39
-
Next
40
-
```
41
-
./init-dynamodb.sh
42
-
```
88
+
## Scripts
89
+
1. Drop/delete tables: `npm run drop-tables`
90
+
2. Creating tables: `npm run create-tables`
91
+
3. Seed/Insert data to tables: `npm run seed-tables`
92
+
4. Initialize/Clear database in default environment: `npm run init-db`
93
+
5. View table data in default environment: `npm run view-data <ModelName>`, ModelName can be `Challenge`, `ChallengeType`, `ChallengeSetting`, `AuditLog`, `Phase`, `TimelineTemplate`or `Attachment`
94
+
6. Create Elasticsearch index: `npm run init-db`, or to re-create index: `npm run init-db force`
95
+
7. Synchronize ES data and DynamoDB data: `npm run sync-es`
43
96
44
-
3. Now the tables have been created, you can use following command to verify
- clear the environment, run command `npm run init-db` and `npm run init-es force`
4
5
- import Postman collection and environment in the docs folder to Postman
5
-
-note that the Postman tests depend on the test data, so you must first run `npm run init-db` and `npm run test-data`to setup test data
6
-
-Just run the whole test cases under provided environment.
6
+
-run tests from up to down in order
7
+
-You need to run command `npm run sync-es` before you run `Challenges/get challenge` and `Challenges/search challenge` test case.
7
8
8
9
## DynamoDB Verification
9
-
1. Open a new console and run the command `docker exec -ti dynamodb sh` to use `aws-cli`
10
-
11
-
2. On the console you opened in step 1, run these following commands you can verify the data that inserted into database during the executing of postman tests
Run command `npm run view-data <ModelName>` to view table data, ModelName can be `Challenge`, `ChallengeType`, `ChallengeSetting`, `AuditLog`, `Phase`, `TimelineTemplate`or `Attachment`
11
+
12
+
## S3 Verification
13
+
14
+
Login to AWS Console, S3 service, view the bucket content.
15
+
16
+
## ElasticSearch Verification
17
+
18
+
Run command `npm run view-es-data` to view data store in ES.
19
+
20
+
## Bus Event Verification
21
+
22
+
- login `https://lauscher.topcoder-dev.com/` with credential `tonyj / appirio123`
23
+
- then select topic to view, see app-constants.js Topics field for used topics, then click `View` button to view related messages
0 commit comments