Skip to content

Commit

Permalink
hotfix and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Mar 23, 2024
1 parent b3f4a8d commit bc6081b
Show file tree
Hide file tree
Showing 416 changed files with 428 additions and 115 deletions.
12 changes: 11 additions & 1 deletion docs/cmds/variability/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import * as files from '#files'
import Loader from '#graph/loader'
import {ServiceTemplate} from '#spec/service-template'
import {InputAssignmentMap} from '#spec/topology-template'
import _ from 'lodash'
import * as path from 'path'

type Test = {
Expand Down Expand Up @@ -40,12 +41,21 @@ async function main() {
const inputs = getDefaultInputs(dir)
? files.loadYAML<InputAssignmentMap>(getDefaultInputs(dir)!)
: undefined

let expected
if (!check.isDefined(config.error)) {
expected = loadExpected({dir, file: config.expected})
if (check.isDefined(config.merge)) {
expected = _.merge(expected, config.merge)
}
}

tests.push({
id,
config,
inputs,
template,
expected: check.isDefined(config.error) ? undefined : loadExpected({dir, file: config.expected}),
expected,
file: `test-${id}.md`,
})
})
Expand Down
10 changes: 10 additions & 0 deletions docs/cmds/variability/test.template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ The following variability preset is used.
```
<% } -%>
<% if (test.config.replace) { -%>
## Replace
The following strings are searched and replaced in the variability-resolved service template.
```yaml linenums="1"
<%- utils.toYAML(test.config.replace) -%>
```
<% } -%>
<% if (test.expected) { -%>
## Variability-Resolved Service Template
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/publications.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This document holds a list of selected publications.
- CLOSER 2024
- _Accepted_
- [Step-by-Step Guide](variability4tosca/guides/aware/index.md){target=_blank}
- {{ repo_link('tests/hosting-aware-pruning ', 'Models of the Case Study') }}
- {{ repo_link('examples ', 'Models of the Case Study') }} (Relevant models start with "unfurl-aware")
- [GitHub Actions](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml){target=_blank} (Relevant jobs start with "Unfurl Aware")
- [GitHub Actions Raw Logs](assets/documents/night.zip){target=_blank} (Relevant jobs start with "Unfurl Aware")
- [Assets on Zenodo](https://doi.org/10.5281/zenodo.10452506){target=_blank}
Expand All @@ -29,7 +29,7 @@ This document holds a list of selected publications.
- _Accepted_
- [Step-by-Step Guide](variability4tosca/guides/modes/index.md){target=_blank}
- {{ repo_link('tests/enricher', 'Models of the Experiments') }}
- {{ repo_link('tests/pruning-modes', 'Models of the Case Study') }}
- {{ repo_link('examples ', 'Models of the Case Study') }} (Relevant models start with "xopera-pruning")
- [GitHub Actions](https://github.com/OpenTOSCA/opentosca-vintner/actions/workflows/night.yaml){target=_blank} (Relevant jobs start with "xOpera Pruning Mode")
- [GitHub Actions Raw Logs](assets/documents/night.zip){target=_blank} (Relevant jobs start with "xOpera Pruning Mode")
- [Assets on Zenodo](https://doi.org/10.5281/zenodo.10363694){target=_blank}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/variability4tosca/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following configurations can be configured in the test configuration file.
| error | false | String | The expected error that is thrown. |
| template | false | String | Path (relative to `test.yaml`) to the variable service template. |
| expected | false | String | Path (relative to `test.yaml`) to the expected service template after resolving variability. |
| renames | false | List(Tuple(Find: String, Replace: String)) | An optional list of strings to search and replace for in the generated service template. |
| replace | false | List(Tuple(Find: String, Replace: String)) | An optional list of strings to search and replace for in the generated service template. |
| merge | false | Object | An optional object that is merged into the expected service template. |


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/variability4tosca/tests/test-artifacts-prune.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ topology_template:
## Expected Error
The following error is expected to be thrown, when resolving variability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Expected Error
The following error is expected to be thrown, when resolving variability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ topology_template:
## Expected Error
The following error is expected to be thrown, when resolving variability.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ topology_template:
## Variability-Resolved Service Template
The following variability-resolved service template is expected.
Expand Down
Loading

0 comments on commit bc6081b

Please sign in to comment.