Comments (5)
- Sharing common API request headers used in every runbooks (and used multiple times in a runbook)
On second thought, this scenario can be covered if HTTP runner have a global-headers option mentioned in #619.
from runn.
@h6ah4i Thank you for your proposal!
I think this is a very interesting proposal.
However, I do not see any strong reason to introduce it at this time.
- The ability to reference other files is not an inherent feature of YAML.
- runn has Include runner. Some of what you want to achieve with the include runner may be possible.
- runn has the ability to expand environment variables. Some of what you want to achieve with the variable expansion feature may be possible. It will work especially well with anchors and aliases.
- Some of what you want to achieve can be accomplished by concatenating the runbook with a reference YAML file in the tmp directory before the runn is executed. It will work especially well with anchors and aliases.
This is my opinion, and I also believe that in the context of testing, it should not be too DRY. I think the features of anchors and aliases should be sufficient.
from runn.
Thank you for reply 🙇♂️
- The ability to reference other files is not an inherent feature of YAML.
Exactly. This is also my biggest concern.
- runn has Include runner. Some of what you want to achieve with the include runner may be possible.
- runn has the ability to expand environment variables. Some of what you want to achieve with the variable expansion feature may be possible. It will work especially well with anchors and aliases.
- Some of what you want to achieve can be accomplished by concatenating the runbook with a reference YAML file in the tmp directory before the runn is executed. It will work especially well with anchors and aliases.
This is my opinion, and I also believe that in the context of testing, it should not be too DRY. I think the features of anchors and aliases should be sufficient.
You are totally right too, tests should not be too DRY and the technics 2, 3 and 4 are good practices for reducing duplication of runbook contents.
The technic 4 seems like the closest thing to what I want to do, but this approach can be a huge pain if you have so many runbooks. (I am already use the technics 2 and 3.)
Situations where I would like to use the --yaml-references
option are only the followings for now. These are not main interest of the tests, but I have to write them over and over again.
- Sharing db/api runner declarations used in every runbooks
- Sharing common API request headers used in every runbooks (and used multiple times in a runbook)
from runn.
Thank you!!
I do not want to put additional features directly into runn's YAML processing. I wish there was another way to do more.
If you want to make runbooks more DRY, you may want to consider using runn as a package.
- Sharing db/api runner declarations used in every runbooks
I have solved this by writing code that reads using runn.Runner option.
Or the --runner
option might work.
- Sharing common API request headers used in every runbooks (and used multiple times in a runbook)
runn.Var option could be used.
from runn.
Yes, using runn as a Go's test helper package offers great flexibility. Even so, I love using runn as a standalone tool because it's still powerful and very handy.
Or the --runner option might work.
Thanks, I have not noticed the option! But unfortunately, it seems that it only supports runner without options (non map form in YAML format). It would be nice if we can specify YAML file(s) that contains runner setups in runbook format instead.
from runn.
Related Issues (20)
- How can I loop over multiple steps? HOT 2
- Failed to multipart/form-data request with very long value HOT 5
- Specify the header name for the trace header HOT 5
- Bind the response for each loop in a variable HOT 3
- Issues Encountered While Testing a Multi-Service gRPC Server with Runn HOT 5
- spanner: code = "InvalidArgument", desc = "invalid session pool"
- How to count tests that were not completed in time for load testing HOT 2
- Add coverage rate to json format when getting OpenAPI Spec coverage HOT 5
- Support for the shard option of the coverage command HOT 1
- Using a variable passed from parent runner for the loop count specifier HOT 1
- Regression: flattenYamlAliases() breaks CRLF encoded runbooks in a certain situation HOT 1
- Additional coverage can be checked after the runn run HOT 2
- [Feature Request] Make concurrency field accepts multiple values HOT 1
- Is there way runn test of grpc with using "buf/validate/validate.proto" in proto ? HOT 5
- concurrency: option seems not working HOT 2
- 🐛 bug: Error messages are not displayed correctly HOT 1
- [Feature request] Add diff output when compare() returns false HOT 3
- How to specify an absolute path to load JSON file HOT 5
- Including string literal `{{ ... }}` in HTTP request body HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runn.