Closed zanete closed 3 weeks ago
@zanete @pazbardanl please take a look at the ticket - I consider this ready to work on.
@jmcook1186 , that's awesome, very quick work! All of the scenarios make sense apart from the first one. Perhaps this is because I'm really new to the framework and have n't used it myself, I'm a bit confused about what you'd expect to happen.
I'd recommend phrasing it so that the Given is a precondition, When is the trigger and Then is all that happens, for example:
Given A User has downloaded and installed if
and if-plugins
When User executes a pipeline that contains subtract
Then The framework subtracts any parameters ... etc,
You could even be more specific about the use of the subtract
and add multiple pipeline examples in a table and the corresponding outputs you expect. This would show a few ways you'd envisage the plugin to be used and what the behaviour for each case should be
e.g.
Given A User has downloaded and installed if
and if-plugins
When User executes the pipeline defined in the table
Then The framework outputs the results as defined in the table for the corresponding row
ID | Pipeline | Results |
---|---|---|
1 | pipeline 1 | results 1 |
2 | pipeline 2 | results 2 |
3 | pipeline 3 | results 3 |
cc @pazbardanl @jawache
hi @zanete / @jmcook1186 can i get a hint / pointer on this: documentation is added to if.greensoftware.foundation which repo is that? thanks :)
Hi @pazbardanl you can add dosc to if.greensoftware.foundation by raising PRs against the if-docs repo (https://github.com/Green-Software-Foundation/if-docs). All that is required there is to add the link to the plugin README file on https://if.greensoftware.foundation/reference/plugins following the format of the other plugins.
Thanks for this @pazbardanl, great work.
And @zanete that's a great idea, generally I think it's good for plugin ACs to just be manifest files that people can run so there is no ambiguity, but if there are lots of edge cases it can save a lot of time if it's just a table, given this manifest file, if you replace the values according to those in this table then it should output the last col etc...
@manushak please review
Sub of: #656
What Create a new generic
subtract
plugin in 'if-plugins`Why We want to support as many pipelines as possible using generic plugins that can be adapted to many use cases. We currently have
sum
,multiply
,coefficient
. We also need to supportsubtract
. As a user I want to be able to execute any arbitrary logic usingif
plugins.Prerequisites/resources None
SoW (scope of work)
if-plugins
repoif-plugins
repoif.greensoftware.foundation
if
repo demonmstrating usageNote the plugin code can be copied from the
sum
plugin and modified to subtract rather than add.Acceptance criteria
[x] A plugin called
Subtract
exists in theif-plugins
repository Given (Setup): thesubtract
plugin exists When (Action): a user has downloaded and installedif
andif-plugins
Then (Assertion): the user should be able to includesubtract
in a pipeline and subtract any parameter that exists in their input data from any other parameter in their input data.[x] Unit tests exists with 100% coverage over
subtract
Given (Setup): a user has downloaded and installedif-plugins
When (Action): a user runsnpx jest --coverage
Then (Assertion): the coverage report should show thatsubtract
is 100% covered and passing[x] Documentation exists in plugin readme Given (Setup): the user visits the
if-plugins
repository When the user navigates tosrc/lib/subtract
Then the user sees a README containing documentation describing thesubtract
plugin, copying the format from the other plugin readmes.[ ] Documentation exists in if.greensoftware.foundation Given: the user is on if.greensoftware.foundation When (Action): they navigate to
reference/plugins
and find thesubtract
plugin section Then (Assertion): they see a link to the plugin readme for the subtract plugin[x] Example manifests exists Given: the user has downloaded and installed
if
When (Action): the user navigates toif/manifests/plugins
Then (Assertion): they see manifests that include thesubtract
plugin