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
@@ -56,28 +56,29 @@ For using with SSL, the options should be as
56
56
{
57
57
connectionString: '<server>',
58
58
ssl: {
59
-
cert: '<certificate>',
59
+
cert: '<certificate>',
60
60
key: '<key>'
61
61
}
62
62
}
63
63
```
64
64
65
65
The following config paramaters are supported in the test environment defined in `config/test.js` and can be configured in the system environment. Note that the test config inherits all config options present in the default config and adds/overrides some config options.
| TC_URL | the topcoder development url |https://www.topcoder-dev.com|
70
-
| TC_DEV_API_URL | the topcoder development api url |https://api.topcoder-dev.com/v3|
71
-
| MAX_RETRY_COUNT | the maximum number of times to re-test before concluding that test failed |https://api.topcoder-dev.com/v3|
72
-
| WAIT_TIME | the amount of time in milliseconds to wait before running a re-test | 30000 |
73
-
| TC_DIRECT_ID | the topcoder direct id of the repository which is set up with a valid billing account | 7377 |
74
-
| TOPCODER_USER_NAME | a valid username for topcoder dev platform | mess |
75
-
| HOOK_BASE_URL | the webhook url of topcoder-x-receiver ||
76
-
| GITHUB_ACCESS_TOKEN | github personal access token ||
77
-
| GITHUB_REPOSITORY_NAME | the name of the repository to create for testing (should not already exist) ||
78
-
| GITLAB_USERNAME | gitlab username ||
79
-
| GITLAB_PASSWORD | gitlab password ||
80
-
| GITLAB_REPOSITORY_NAME | the name of the repository to create for testing (should not already exist) ||
67
+
| Name | Description | Default |
68
+
|:--|:--|:--|
69
+
| TC_URL | the topcoder development url |https://www.topcoder-dev.com|
70
+
| TC_DEV_API_URL | the topcoder development api url |https://api.topcoder-dev.com/v3|
71
+
| MAX_RETRY_COUNT | the maximum number of times to re-test before concluding that test failed | 17 |
72
+
| WAIT_TIME | the amount of time in milliseconds to wait before running a re-test | 60000 |
73
+
| TC_DIRECT_ID | the topcoder direct id of the repository which is set up with a valid billing account | 7377 |
74
+
| TOPCODER_USER_NAME | a valid username for topcoder dev platform | mess |
75
+
| HOOK_BASE_URL | the webhook url of topcoder-x-receiver ||
76
+
| GITHUB_ACCESS_TOKEN | github personal access token ||
77
+
| GITHUB_REPOSITORY_NAME | the name of the repository to create for testing (should not already exist) ||
78
+
| GITLAB_USERNAME | gitlab username ||
79
+
| GITLAB_PASSWORD | gitlab password ||
80
+
| GITLAB_REPOSITORY_NAME | the name of the repository to create for testing (should already exist) ||
81
+
| GITLAB_REPO_URL | the URL of the repository to create for testing (should already exist) ||
81
82
82
83
## Local Deployment
83
84
@@ -103,9 +104,14 @@ Configure the Github access tokens, Gitlab username and password in `config/test
103
104
104
105
To create a Github personal access token, click on Settings -> Developer settings -> Personal access tokens -> Generate new token -> Provide all permissions.
105
106
106
-
Configure gitlab username and password.
107
+
Configure gitlab username, password, repo name and repo url.
108
+
109
+
Gitlab Testing:
110
+
- Please make sure set repo info via Topcoder-X-UI
111
+
112
+
Github Testing:
113
+
- Do not need set repo info at Topcoder-X-UI
107
114
108
-
Now provide repository names which do not already exist.
109
115
110
116
You can then run both github and gitlab tests by using
111
117
```
@@ -123,121 +129,136 @@ npm run test:gitlab
123
129
## Verification
124
130
125
131
- create an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.created` event is generated.
132
+
126
133
- update an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.updated` event is generated.
134
+
127
135
- create a comment on an issue, you can see the logs in `receiver` and `processor`, the `comment.created` event is generated.
136
+
128
137
- update a comment on an issue, you can see the logs in `receiver` and `processor`, the `comment.updated` event is generated.
138
+
129
139
- assigned a user to an issue, you can see the logs in `receiver` and `processor`, the `issue.assigned` event is generated.
140
+
130
141
- unassigned a user to an issue, you can see the logs in `receiver` and `processor`, the `issue.unassigned` event is generated.
142
+
131
143
- add or remove a label to an issue, you can see the logs in `receiver` and `processor`, the `issue.labelUpdated` event is generated.
144
+
132
145
- create a pull request, you can see the logs in `receiver` and `processor`, the `pull_request.created` event is generated.
146
+
133
147
- close a pull request without merge, you can see the logs in `receiver` and `processor`, the `pull_request.closed` event is generated and the `merged` property is `false`.
148
+
134
149
- merge a pull request, you can see the logs in `receiver` and `processor`, the `pull_request.closed` event is generated and the `merged` property is `true`.
150
+
135
151
- close an issue in the repo, you can see the logs in `receiver` and `processor`, the `issue.closed` event is generated
136
152
153
+
154
+
137
155
### Create a new challenge for a new issue
156
+
138
157
- Create a new issue in the repo. E.g.
139
-
- With the title: [$20] A new issue title
140
-
- With the body (Markdown supported):
141
-
```
142
-
## A new issue body header
143
-
144
-
A new issue body content with ***bold*** text and a [link](https://github.com/ngoctay/Luettich-test/issues/).
145
-
```
146
-
- You will see a new project created in the logs if project for that repository is not created already. E.g.
147
-
```
148
-
debug: new project created with id 11916 for issue 3
149
-
```
150
-
- Then a new challenge created in the logs. E.g.
151
-
```
152
-
debug: new challenge created with id 30051089 for issue 3
153
-
```
154
-
- Wait a minute or 2 for Topcoder internal systems to process the new challenge. You may get an error page `HTTP Status 404` if the internal processing haven't completed yet.
***NOTE***: change 30051089 to the your challenge id created in the previous step
160
158
161
-
### Update the challenge when the issue was updated
159
+
- With the title: [$1] This is a test issue
162
160
163
-
- Update title of the issue above. E.g.
164
-
- With the title: [$50] A new issue title - Updated the prize
165
-
- Wait a minute or 2
166
-
- Visit the challenge url to verify the updated prize and title
161
+
- With the body (Markdown supported):
167
162
168
-
- Update the body of the issue. E.g.
169
-
```
170
-
## A new issue body header - Updated
171
-
172
-
A new issue body content with ***bold*** text and a [link](https://github.com/ngoctay/Luettich-test/issues/). Updated
173
-
```
174
-
- Wait a minute or 2
175
-
- Visit the challenge url to verify the updated body
176
-
177
-
- Now try to update the title by adding a space after $50: [$50 ] A new issue title - Updated the prize
178
-
- The event will be ignored by processor:
179
-
```
180
-
debug: nothing changed for issue 3
181
-
```
182
-
183
-
- Update the title by removing `[$50 ]`, you'll get an error:
184
-
```
185
-
error: Error: Cannot parse prize from title: A new issue title - Updated the prize
186
-
```
187
-
188
-
### Process Bidding Comments
189
-
- Add/update comment to bid or accept the bid
190
-
- To bid on the issue, comment as `/bid $50`. Minimum one space is need between /bid and $ sign. This will trigger `comment.created` or `comment.updated` event based on comment create/edit.
191
-
- if comment is bid then an email is sent to the user configured in `ISSUE_BID_EMAIL_RECEIVER` in config file
192
-
- To accept bid on the issue, comment as `/accept_bid @username $50`
193
-
- if comment is accepting bid then
194
-
- title of issue will be changed with accepted bid amount
195
-
- issue will be assigned to user `username` if not already assigned
196
-
197
-
### Issue Assignment
198
-
When an user is assigned to an issue then 'issue.assigned' event will be captured and processed as
199
-
- processor will get the Topcoder handle for such user using Ragnar self service tool api
200
-
- if user is found then the topcoder challenge associated with that issue will be updated as
201
-
- topcoder user will be assigned
202
-
- if user is not found in mapping
203
-
- comment on github/gitlab issue will added as :
204
-
```
205
-
@username, please sign-up with Topcoder x Self-service tool.
206
-
```
207
-
- user will be unassigned from issue
208
-
209
-
### Closing issue
210
-
211
-
When an issue is closed it will first check if issue has any assignee or not,
212
-
213
-
- if there is no assignee then simply ignores the issue closed event with message in logger
214
-
- if there is an assignee then it will
215
-
- first set the current assignee user as challenge assignee,
216
-
- activate the challenge with project's billing
217
-
- closes the challenge with winner as assignee
218
-
- you can verify the challenge closed in OR (link will be commented in same issue in git host)
219
-
- issue label will be updated from configured paid and fix accepted label name
220
-
- if there is no fix_accepted label or prize is zero then the challenge will cancelled
221
-
222
-
You can see following logs
223
163
```
224
-
debug: Looking up TC handle of git user: 82332
225
-
debug: Getting the billing account ID for project ID: 15180
226
-
debug: Getting project billing detail 15180
227
-
debug: assigning the billing account id 70016668 to challenge
228
-
debug: Updating challenge 30052019 with {"billingAccountId":70016668,"prizes":[234]}
229
-
debug: Getting the topcoder member ID for member name: tonyj
230
-
debug: Getting the topcoder member ID for copilot name : tonyj
231
-
debug: adding resource to challenge 30052019
232
-
debug: resource is added to challenge 30052019 successfully.
233
-
debug: adding resource to challenge 30052019
234
-
debug: Activating challenge 30052019
235
-
debug: Challenge 30052019 is activated successfully.
236
-
debug: close challenge with winner tonyj(8547899)
237
-
debug: Closing challenge 30052019
238
-
debug: Challenge 30052019 is closed successfully.
239
-
debug: update issue as paid
240
-
debug: Gitlab/Github issue is updated for as paid and fix accepted for 59
164
+
This is a description
241
165
```
242
166
243
-
- if issue have already paid label it won't process
167
+
- You will see a new comments
168
+
169
+
Contest https://www.topcoder-dev.com/challenges/30054075 has been created for this ticket.
170
+
171
+
```This is an automated message for tonyj via Topcoder X```
172
+
173
+
174
+
- Visit challenge url to verify the challenge:
175
+
176
+
```
177
+
https://www.topcoder-dev.com/challenges/30054075
178
+
```
179
+
180
+
### Update the challenge when the issue's prize was updated
181
+
182
+
- Update prize of the issue
183
+
- With the title: [$2] This is a test issue
184
+
- Wait a minute or more
185
+
- Visit the challenge url to verify the updated prize and title
186
+
187
+
### Update the challenge when the issue's title was updated
188
+
189
+
- Update title of the issue
190
+
- With the title: [$2] This is an updated test issue
191
+
- Wait a minute or more
192
+
- Visit the challenge url to verify the updated title
193
+
194
+
### Update the challenge when the issue's description was updated
195
+
196
+
- Update description of the issue
197
+
- With the title: This is an updated description
198
+
- Wait a minute or more
199
+
- Visit the challenge url to verify the updated description
200
+
201
+
### Update the challenge when assigning the ticket
202
+
203
+
- Assign issue to member
204
+
- Wait a minute or more
205
+
- ticket added [tcx_Assigned](https://github.com/nauhil/test-unit/labels/tcx_Assigned) and removed [tcx_OpenForPickup](https://github.com/nauhil/test-unit/labels/tcx_OpenForPickup)
206
+
- ticket added assignee
207
+
- add comments
208
+
209
+
Contest https://www.topcoder-dev.com/challenges/30054075 has been updated - it has been assigned to tonyj.<br/><br/>```This is an automated message for tonyj via Topcoder X```
210
+
211
+
- Visit the challenge url to verify registered member
212
+
213
+
### Update the challenge when assigning the ticket - no mapping exists
214
+
215
+
- Remove exists assignee
216
+
- Remove user mapping data in DB
217
+
- Assign issue to member
218
+
- Wait a minute or more
219
+
- ticket adds commets
220
+
221
+
@xxx, please sign-up with Topcoder X tool<br/><br/>```This is an automated message for tonyj via Topcoder X```
222
+
- ticket removed their assignment
223
+
224
+
### Update the challenge when unassigning the ticket
225
+
226
+
- Unassign member of issue
227
+
- Wait a minute or more
228
+
- Ticket adds comments
229
+
Contest https://www.topcoder-dev.com/challenges/30054075 has been updated - tonyj has been unassigned.<br/><br/>```This is an automated message for tonyj via Topcoder X```
230
+
- Ticket updated labels
231
+
added tcx_OpenForPickup and removed tcx_Assigned labels
232
+
- Visit the challenge url to verify no registered member
233
+
234
+
### Update the challenge when unassigning the ticket - no assigne exists
235
+
236
+
- Ticket adds tcx_FixAccepted label
237
+
- Unassign member of issue
238
+
- Close ticket
239
+
- Wait a long time
240
+
- THIS TEST WILL FAIL as the issue is not reopened if no assignee exists. It is ignored with a log message
241
+
242
+
### Update the challenge when close the ticket - without tcx_FixAccepted label
243
+
244
+
- Remove tcx_FixAccepted label
245
+
- Assign issue to member
246
+
- Close ticket
247
+
- Wait a minute or more
248
+
- Ticket adds comments
249
+
This ticket was not processed for payment. If you would like to process it for payment, please reopen it, add the ```tcx_FixAccepted``` label, and then close it again<br/><br/>```This is an automated message for tonyj via Topcoder X```
250
+
- Ticket reopend
251
+
- Visit the challenge on TC Direct to verfy chalenge status is Active
252
+
253
+
254
+
### Update the challenge when close the ticket
255
+
256
+
- Assign issue to member
257
+
- Ticket add tcx_FixAccepted label
258
+
- Close ticket
259
+
- Ticket adds tcx_Paid label
260
+
- Ticket adds comments
261
+
Payment task has been updated: https://software.topcoder-dev.com/review/actions/ViewProjectDetails?pid=30054000<br/><br/>```This is an automated message for tonyj via Topcoder X```
262
+
- Ticket closed comment
263
+
- Wait a long time (Challenge status will change to Active and then change to Completed for long time later)
264
+
- Visit the challenge on TC Direct to verify challenge status is Active and change to Completed after 17 minute or more
0 commit comments