Comments (11)
YAML support would be nice. The only concern is comments. They would disapear when a goss add...
is run. Would that be an issue?
from goss.
Yeah that's true. That would be a problem. Not sure how to solve that one!
from goss.
Hello!
What if the resource blocks had support for a name
or comment
field, similar to the name
field on Ansbile tasks? It would be optional and, to avoid disrupting the current structure, would be bellow the actual resource name. For example:
command:
name: Check that redis-cli info is available and executing ok
redis-cli info:
exit-status: '0'
stdout: [redis_version]
This would pretty much kill the need for comments on this files, which I believe is a good workaroud and compromise.
from goss.
@mtpereira That sounds great! I assume name
would be nested under the redis-cli object, right?
---
command:
redis-cli info:
name: Check that redis-cli info is available and executing ok
exit-status: '0'
stdout: [redis_version]
from goss.
@aelsabbahy Well, yeah, that does make much more sense! 👍 I've placed it outside because I was influenced by Ansible's tasks layout.
from goss.
I think my next step would be to decouple the storage format (JSON) logic from the core logic and add a name
, comment
or description
attribute. Once that's done it'll be easy to add more formats as needed.
I'm still not 100% sure that YAML can be pulled off without breaking goss add
, since it would most likely break references.
- nice things like references to other places in the YAML
Thoughts?
from goss.
Possibly you could use an _ prefix for metadata fields. In that case, you could just ignore anything you don't understand, so _comment, _todo, _for_service, etc are all equally valid but more descriptive because they're semi structured
from goss.
And yeah, I think you're right @aelsabbahy; regenerating YAML is problematic when you do refs and comments.
Since you know the structure, and it's not complex you could always dump the new element separately and just append it to the file, but that seems like it could be error prone in cases where (for example) the root node is JSON, or the file structure is malformed
from goss.
Yeah, that's the part I'm mentally struggling with. Refs are cool, but if goss add
expands them out, then running it would remove the benefits of having refs in the first place.
Either way.. I'll keep this open and revisit after code de-coupling.
from goss.
Waiting for the outcome of:
go-yaml/yaml#132
References are still a concern though.
from goss.
Released in v0.1.0
from goss.
Related Issues (20)
- Add optional correction attribute to tests giving command to run on test failure HOT 3
- if statement returns "invalid memory address or nil pointer dereference" error HOT 9
- Add JSON schema to schemastore.org for integration into VSCode HOT 4
- Json output format doesn't print skipped count in summary section HOT 2
- Using goss to validate a remote system HOT 2
- Traces log for command to include exec content and full stdout/stderr HOT 20
- Display additional information or test origin for failed tests HOT 4
- goss add command to set default assertions for empty stdout/stderr HOT 4
- What could be causing `unexpected word (expecting ")")`? HOT 3
- Breaking change in v0.4.0-rc.1 needs release doc fix HOT 3
- check single resource HOT 3
- Add darwin/arm64 support HOT 4
- Validate with json formatting always returns `successful: false` even for successful tests HOT 2
- incomprehensible behavior when testing with different versions of goss HOT 19
- Error with `contain-substring/mach-regexp` matcher and `json/junit` formatters HOT 2
- Unable to detect `php-fpm` service with `port` resource HOT 3
- Goss crashes when json or junit output is used with io.Readers HOT 1
- Publish documentation HOT 3
- Facing Error exec: not started while executing tests of type command HOT 9
- Goss Linux AMD64 Download Mislabeled HOT 2
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 goss.