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
We need to implement unit tests for the Topcoder-X receiver and processor to ensure that all facets of ticket handling are processing correctly.
We will use these unit tests before and after deployments to prod to ensure:
An update works before it's deployed
The deployed code to prod is working as expected
Existing tests
Note that tests for Gitlab were recently checked in, with similar requirements to these Github tests. You can use those as reference, but note that the review identified some issues with those tests that have yet to be fixed:
Please refactor and reuse as much code between the Gitlab and Github implementations as possible. This will make it easier to maintain the code in the future.
Development
You can use the Github API to manipulate the tickets as needed. You need to ensure that you properly describe the configuration needed, including the API and Github project setup.
Your unit tests should not leave anything behind when they run. All cleanup should be part of the test setup and takedown.
You should use the Topcoder challenge API for validating the Topcoder platform challenge information. As with the Github issues, no Topcoder challenges should be left open when the unit tests are done.
Unit tests
The unit tests have to cover:
Creating a Github ticket
Ensure that the challenge is created properly in the Topcoder platform
Ensure that the challenge TC Direct ID matches the configured TC Direct ID in topcoder-x
Ensure that the challenge title, description, and prize matches the ticket title
Ensure that the comment added to the Git ticket is correct and has a proper link to the TC challenge
Updating a Github ticket - prize
Ensure that the prize is updated properly on the TC challenge
Ensure that the comment is added back to the Github ticket explaining that the prize was updated
Updating a Github ticket - title
Ensure that the title is updated properly on the TC challenge
Updating a Github ticket - description
Ensure that the description is updated properly on the TC challenge
Assign a Github ticket
Ensure that the TC member is added to the TC challenge as expected
If no mapping exists for the assignee on Github for a TC member, ensure a comment is added explaining that the user has to register with Topcoder X.
Ensure that a comment is added to the Github ticket with a success message when the assignment is successful
Unassign a Github ticket
Ensure that the TC challenge goes back to unassigned and the existing assignee is removed
Ensure that a comment is added to the Github ticket with a success message when the unassignment is successful.
Close a Github ticket
Ensure that the challenge is activated on the TC platform
Ensure that the copilot is assigned on the TC platform
Ensure that the challenge is closed successfully on the TC platform
If there's no assignee, ensure a comment is added to the Github ticket and the ticket is reopened
If an error occurs, ensure a comment is added to the Github ticket and the ticket is reopened
Running the unit tests
The code is deployed to Heroku for both development and prod environments. The unit tests should be able to be run on Heroku as part of the deployment.
We need to implement unit tests for the Topcoder-X receiver and processor to ensure that all facets of ticket handling are processing correctly.
We will use these unit tests before and after deployments to prod to ensure:
Existing tests
Note that tests for Gitlab were recently checked in, with similar requirements to these Github tests. You can use those as reference, but note that the review identified some issues with those tests that have yet to be fixed:
Code reuse
Please refactor and reuse as much code between the Gitlab and Github implementations as possible. This will make it easier to maintain the code in the future.
Development
You can use the Github API to manipulate the tickets as needed. You need to ensure that you properly describe the configuration needed, including the API and Github project setup.
Your unit tests should not leave anything behind when they run. All cleanup should be part of the test setup and takedown.
You should use the Topcoder challenge API for validating the Topcoder platform challenge information. As with the Github issues, no Topcoder challenges should be left open when the unit tests are done.
Unit tests
The unit tests have to cover:
Creating a Github ticket
Updating a Github ticket - prize
Updating a Github ticket - title
Updating a Github ticket - description
Assign a Github ticket
Unassign a Github ticket
Close a Github ticket
Running the unit tests
The code is deployed to Heroku for both development and prod environments. The unit tests should be able to be run on Heroku as part of the deployment.
https://devcenter.heroku.com/categories/continuous-integration
The text was updated successfully, but these errors were encountered: