eiffel-community / eiffel

The Eiffel framework vocabulary, descriptions, guides and schemas along with links to relevant implementation repositories.
Apache License 2.0
124 stars 60 forks source link

Support modeling activities that finish without doing anything #406

Open magnusbaeck opened 2 weeks ago

magnusbaeck commented 2 weeks ago

Summary

As someone who attempts to model a CI system I want a way to model an activity that finished early because it realized that there's nothing to do So that I can compute correct metrics or visualize the behavior

Context

There are cases where activities need to start executing and won't complete in the normal fashion, but rather short-circuit themselves and not do anything. This would be an additional possible outcome of an activity, expressing "yes, technically I started but it turned out that there was nothing for me to do", which isn't the same thing as "successful", "failure", "abort", or any of the other possible current outcomes.

In CDEvents, the testSuiteRun finished event has an outcome field whose value space currently is "pass", "fail", "cancel", and "error", where "cancel" is what's currently missing in Eiffel. Since "cancel" already means something in the context of Eiffel activities, we should choose another term. Perhaps "skipped"?

Exemplification

An activity tasked with completing an artifact build could have a caching mechanism that, after an analysis, concludes that nothing needs to be done except send an EiffelArtifactReusedEvent. It would be useful to outside observers to be able to distinguish such activities from the usual ones that take much longer and eventually result in an EiffelArtifactCreatedEvent.

Drawbacks

No response

Out of Scope

No response

Further links

No response

Acceptance Criteria

No response

Implementation Ideas

The data.outcome.conclusion member of EiffelActivityFinishedEvent should be given an additional enum value, e.g. "SKIPPED".

The same thing should be considered for EiffelTestCaseFinishedEvent, but a concrete use case is less clear to me. It's my impression that test cases execution is usually predetermined, but I'm sure there are cases where they need to skip their execution when they've started.

e-backmark-ericsson commented 6 days ago

See also this commit in a CDEvents PR related to noop activities: https://github.com/cdevents/spec/pull/238/files/da08d70d23d08bc799232a587051026e43eaf4ca..53e8fe1de6a62ccf0eb61d803bb5eb71bb45c5e6