Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a test run starts, Edison should send a callout to tell the website a run has started #62

Closed
Badgerati opened this issue Mar 5, 2017 · 6 comments
Assignees
Milestone

Comments

@Badgerati
Copy link
Owner

Badgerati commented Mar 5, 2017

The idea here is that when a test run starts, Edison should send a callout to the website.

This callout should be to an endpoint that informs the endpoint that a run has started, to create any initial data - like the test run name/ID/project etc. - as well as to return a "SessionId" that should be used when sending test results later on. As well as the "test run has ended" callout.

This new "SessionId" is because a test run could have the same ID and Name, so determining which to assign results to is difficult.

@Badgerati
Copy link
Owner Author

This SessionId could be anything, but mostly it could be either an actual session token that expires on the final "end" call. Or it could just be the internal identifier for the test run. In the end, it's up to the system's architecture to decide.

@Badgerati
Copy link
Owner Author

Due to the fact that only one endpoint can be supplied, this imposes some overhead to the feature.

This is now the basic idea (including the start/end and result calls):

  • Each of the 3 calls will all send POST requests to the supplied endpoint.
  • The data being sent will all be of the same format. To distinguish the calls, there will be an "action" parameter passed which can be either "start"/"end" or "result".
  • If a "result" callout fails 5 times, no further callouts will be made.
  • The "TestRunId" for results that was previously being sent as a query parameter, will now also be POST'd.
  • JSON.NET will be used for the serializing.
  • BIGGEST CHANGE: The URL data format will now only be in JSON. Removing the changes from New UrlOutputType needed, rather than using file's OutputType #61.

Example data format to follow.

@Badgerati Badgerati self-assigned this Mar 6, 2017
@Badgerati
Copy link
Owner Author

Example of a "start" call:

{
    "TestRunId": "v1.20",
    "SessionId": null,
    "Action": "Start",
    "TestResults": null
}

Only the Action and the TestRunId will be populated. A start callout expects some form of SessionId back, this could be a session token, a database ID or something else. Only the SessionId value is to be returned, on it's own, as plain text, with nothing else.

@Badgerati
Copy link
Owner Author

Badgerati commented Mar 6, 2017

Example of a "result" call:

    "TestRunId": "v1.20",
    "SessionId": "ji4737hf489t848784",
    "Action": "Result",
    "TestResults": [
        {
            "TestName": "Edison.Tests.TestClass.TestMethod(1,3)",
            "NameSpace": "Edison.Tests.TestClass",
            "AssemblyName": "Edison.Tests.dll",
            "TestState": "Success",
            "TimeTaken": "00:00:00.0021105",
            "ErrorMessage": "",
            "StackTrace": "",
            "CreateDate": "2017-03-07T19:28:38.2051809+00:00"
        }
    ]

The SessionId will be whatever the SessionId that was returned from the start callout was. If you didn't return one, then you can just use the TestRunId instead if it's already unique.

It is possible, though not currently unless a custom test runner, for results to be multiple.

@Badgerati
Copy link
Owner Author

Also worth remembering that you may get two result callouts for the same test/case if you have re-running enabled.

@Badgerati
Copy link
Owner Author

Merged into epic branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant