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

Added a test execution example #117

Merged
merged 10 commits into from
Mar 27, 2018

Conversation

e-backmark-ericsson
Copy link
Member

To describe how events for a test activity can be linked.

@@ -75,7 +75,7 @@ __Description:__ Identifies the composition from which an artifact declared by [

### ENVIRONMENT
__Required in:__ None
__Optional in:__ [EiffelArtifactCreatedEvent](../eiffel-vocabulary/EiffelArtifactCreatedEvent.md),
__Optional in:__ [EiffelArtifactCreatedEvent](../eiffel-vocabulary/EiffelArtifactCreatedEvent.md), [EiffelTestSuiteStartedEvent](../eiffel-vocabulary/EiffelTestSuiteStartedEvent.md),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want this? What does it mean, conceptually, that a test suite is executed in a particular environment? What happens if the test cases also reference an environment? What if they reference another one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we want it that way. It relates to the discussion of what a test suite really is, which we haven't finalized yet as far as I'm aware.
The scenario I have in mind is that the execution of a TERC is divided into several steps:

  1. For each recipe in the TERC, which might have different test environment needs, we will provision and deploy a test environment. This will render an EiffelEnvironmentDefinedEvent.
  2. The test cases in each recipe, forming a test suite, is then sent to a test executor together with a reference to the created environment to test on.
  3. The executor initiates its test execution by sending an EiffelTestSuiteStarted event referencing the given environment, and then executes each test case in the given test suite.
    Of course it would be awkward if the test case referenced an orthogonal environment to what its test suite did, but that could be handled by rules and guidelines.
    I see the need to discuss this matter in front of a whiteboard, and I look forward to get that possibility in one of the coming weeks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late reply, I've been out of the office...

  1. Yes, makes sense.
  2. Wait, last time we talked about this we said that we should let TERC and TestSuite map 1:1. So if you're using TERC events, you should wrap all test case executions following that in a single TestSuite (hence the TestSuite has a TERC link type). Now you're suggesting that each recipe within the TERC corresponds to a separate TestSuite - there I think is the basic problem.
  3. I think this pretty much just follows from the above problem.

I'll try to schedule a whiteboard session so we can hash this out.

## Introduction
Using Eiffel events to describe the execution of a test activity can be done in wide variety of ways. On one edge, a test activity can be described with Eiffel activity events only, and on the other edge a test activity can be expanded to send a big set of Eiffel events revealing the inner details of the test activity. Which way to choose depends on the complexity of your test execution system and on the need to describe and maybe visualize the nitty-gritty details of the test activity.

The Eiffel protocol provides several events to use within a test activity. This example shows how to make use of most of the Eiffel events related to test activities, with the purpose to present how they all are related.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to explain the context a bit for TERC to make sense to people. I've been thinking of doing this in a screen cast, but haven't had time yet. This would also be a good place.

E.g. "To understand the example provided here, it is important to explain a few concepts. While Eiffel does not make any assumptions about the underlying infrastructure and/or testing methodology, it does encourage separation of concerns. In this view, it is not the responsibility of the activity orchestrator (e.g. the CI server) to determine the test scope, nor is it the responsibility of the test executor. Instead, the EiffelTestExecutionRecipeCollectionEvent makes it possible for a third actor to determine the test scope, which is then handed off to a test executor."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
And for the screen cast, I'd be happy to review the manuscript before you publish it :)

[EiffelTestSuiteFinishedEvents](../eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md) report that a complete test suite is executed.

### IV2A, IV2B
[EiffelIssueVerifiedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md) can be used to override the verdict of a test case reported in a [EiffelTestCaseFinishedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md). These events can also be used to connect one or several test case executions to one or several external issues that by these test case executions are considered verified.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "override" is the correct word here. Rather, what IssueVerified does is allowing you to separate test executions from issue (e.g. requirement) verification. So an IssueVerified may be issued based on a host of test executions, some of which may have a positive verdict and some may not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. To be rephrased.

@e-backmark-ericsson
Copy link
Member Author

@d-stahl-ericsson , I've updated some after our discussion the other week. I took the liberty to not handle it exactly as we agreed... let's have another chat around that when time allows :)

@@ -6,6 +6,8 @@ Using Eiffel events to describe the execution of a test activity can be done in

The Eiffel protocol provides several events to use within a test activity. This example shows how to make use of most of the Eiffel events related to test activities, with the purpose to present how they all are related.

To understand the example provided here, it is important to explain a few concepts. While Eiffel does not make any assumptions about the underlying infrastructure and/or testing methodology, it does encourage separation of concerns. In this view, it is not the responsibility of the activity orchestrator (e.g. the CI server) to determine the contents of the test scope, nor is it the responsibility of the test executor. Instead, the [EiffelTestExecutionRecipeCollectionCreatedEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md) makes it possible for a third actor to determine the test scope, which is then handed off to a test executor. And a forth actor is used to provision and deploy a test environment, based on the environment needs described in the [EiffelTestExecutionRecipeCollectionCreatedEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md), for the test to be executed towards, which is also then handed off to the test executor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: forth

I'm having trouble with the syntax of the last sentence. How about "Then a fourth actor may be used to set up and provide a test environment, based on the needs described in the EiffelTestExecutionRecipeCollectionCreatedEvent, which the test executor may use to run the tests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. To be rephrased.


### EDef1, EDef2
For each test environment set up and/or created an [EiffelEnvironmentDefinedEvents](../eiffel-vocabulary/EiffelEnvironmentDefinedEvent.md) event SHALL be sent. The environments could be static and thereby reused between a lot of test activities, or they could be created in runtime for every test activity. The latter is the typical case when testing in a cloud environment.

### TSS1, TSS2
The [EiffelTestSuiteStartedEvents](../eiffel-vocabulary/EiffelTestSuiteStartedEvent.md) signal that the execution of a set of test cases have started. There may be several such sets defined as "recipes" in the [EiffelTestExecutionRecipeCollectionEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionEvent.md) event. Each of those sets could have their own constraints on the environment in which they should be executed, defined by the _constraints_ parameter in the _recipe_ object in the [EiffelTestExecutionRecipeCollectionEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionEvent.md). The environment used when executing the test suite SHALL be defined using [EiffelEnvironmentDefinedEvents](../eiffel-vocabulary/EiffelEnvironmentDefinedEvent.md)
The [EiffelTestSuiteStartedEvents](../eiffel-vocabulary/EiffelTestSuiteStartedEvent.md) signal that the execution of a set of test cases have started. There may be several such sets defined as "recipes" in the [EiffelTestExecutionRecipeCollectionCreatedEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md) event. Each of those sets could have their own constraints on the environment in which they should be executed, defined by the _constraints_ parameter in the _recipe_ object in the [EiffelTestExecutionRecipeCollectionCreatedEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md). The environment used when executing the test suite SHALL be defined using [EiffelEnvironmentDefinedEvents](../eiffel-vocabulary/EiffelEnvironmentDefinedEvent.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: signal -> signals
Typo: have started -> has started

We're using bold rather than italics to reference property names, and using full paths. I.e. data.batches.recipes.constraints rather than constraints.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -32,13 +34,13 @@ The [EiffelTestSuiteStartedEvents](../eiffel-vocabulary/EiffelTestSuiteStartedEv
[EiffelTestSuiteFinishedEvents](../eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md) report that a complete test suite is executed.

### IV2A, IV2B
[EiffelIssueVerifiedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md) can be used to override the verdict of a test case reported in a [EiffelTestCaseFinishedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md). These events can also be used to connect one or several test case executions to one or several external issues that by these test case executions are considered verified.
[EiffelIssueVerifiedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md) can be used to declare that the execution of a test case has verified a certain issue (e.g. a requirement or a trouble report) successfully or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "bug report" is more universally understood than "trouble report".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

The execution of each test case is surrounded by [EiffelTestCaseStartedEvents](../eiffel-vocabulary/EiffelTestCaseStartedEvent.md) and [EiffelTestCaseFinishedEvents](../eiffel-vocabulary/EiffelTestCaseFinishedEvent.md). When a complete suite of test cases is executed, a [EiffelTestSuiteFinishedEvent](../eiffel-vocabulary/EiffelTestSuiteFinishedEvent.md) is issued.
* When all test suites corresponding to the recipes in the [EiffelTestExecutionRecipeCollectionEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionEvent.md) are finished, the test activity is considered finished and an [EiffelActivityFinishedEvents](../eiffel-vocabulary/EiffelActivityFinishedEvent) is sent to declare that.
* When all test suites corresponding to the recipes in the [EiffelTestExecutionRecipeCollectionCreatedEvent](../eiffel-vocabulary/EiffelTestExecutionRecipeCollectionCreatedEvent.md) are finished, the test activity is considered finished and an [EiffelActivityFinishedEvents](../eiffel-vocabulary/EiffelActivityFinishedEvent) is sent to declare that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "to communicate this fact" rather than "to declare that"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@d-stahl-ericsson
Copy link
Contributor

I think this would be a great addition if updated according to the changes to test events.

@d-stahl-ericsson
Copy link
Contributor

Should this be closed?

@e-backmark-ericsson
Copy link
Member Author

No, it should be updated

@d-stahl-ericsson
Copy link
Contributor

Will it be updated? :)

@e-backmark-ericsson
Copy link
Member Author

Oh, but it was... On August 30th

@e-backmark-ericsson
Copy link
Member Author

It's time to get this PR done... Anyone up for a review?

@d-stahl-ericsson
Copy link
Contributor

Happy to! Are you planning to update the sequence diagram according to our previous conversation, or would you like a review right now?

@e-backmark-ericsson
Copy link
Member Author

The sequence diagram is now updated to reflect our discussions yesterday. Please review :)

@d-stahl-ericsson
Copy link
Contributor

There's one unresolved issue here. We had a conversation above about link from TestSuiteStarted to EnvironmentDefined. What is your thinking there? There is currently no such link, but there is one TestCaseStarted -> EnvironmentDefined, and that's also what the event graph in the example shows. I still think we can't have both, we have to pick one. Even if you were to argue to changing to TestSuiteFinished (and I admit to being skeptical), I would prefer that as a separate PR (because then we're changing event definitions). On a more technical note, following #176 this PR conflicts on this particular point.

The new usage example also needs to be linked from README.md.

For the example itself, some suggestions:

  • "[...] in wide variety of ways. On one edge, a [...] and on the other edge a [...]" -> "[...] in wide variety of ways and with varying numbers of events. On one extreme, a [...] and on the other extreme a [...]"
  • Note sure what the purpose of including unconnected CAUSE links (from ArtC and ActT) is. There are no other CAUSE links in the graph, and there are other link types besides CAUSE that may be relevant.

Added ArtifactCreated/CompositionDefined and
ConfidenceLevelModified events and the links to/from them,
for completeness.

Updated link styles to reflect whether a link is optional or
mandatory.
The sequence diagram is updated where the test executor and the
test manager are switched. The logic is also changed so that the
CI server now calls the test manager to get the TERC and then
calls the test executor.
Added a link in README.md to test-execution.md
Rephrased some in test-execution.md according to review comments.
@e-backmark-ericsson
Copy link
Member Author

I agree to keep the change regarding linking EnvironmentDefined to TestSuiteStarted or not as a separate issue. I've removed it from this PR now.

I added link from the README file and updated the text to match your suggestion.

Regarding the CAUSE links in the events picture I added them there to show that the ActT and ArtC events not just pop up by no reason, but rather due to some reason which is not specified in this picture. I think it could be good to have them there, but if there is a strong reason not to they can very well be removed.

Copy link
Contributor

@d-stahl-ericsson d-stahl-ericsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's get one more to review so we can finally merge this :)

@d-stahl-ericsson
Copy link
Contributor

Created Issue #184 for this.

@d-stahl-ericsson d-stahl-ericsson merged commit 70b7176 into eiffel-community:master Mar 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants