Releases: studio-b12/goat
v1.0.0-beta.1
⚠️ Breaking Changes
-
The built-in template function
base64url
has been renamed tobase64Url
for better naming consistency. [#48] -
The built-in template functions
base64
andbase64Url
do now encode strings to Base64 with leading padding. If you want to encode without padding, use the new functionsbase64Unpadded
andbase64UrlUnpadded
. [#48] -
The previously deprecated alias
headers
for theheader
request section has now been removed.
New Features
- Requesting HTTPS endpoints with self-signed certificates is now possible. [#49, #51]
That means, that the certificate validity is not checked by default. You can pass the--secure
flag or set theGOATARG_SECURE=true
environment variable to enable certificate validation.
Minor Changes and Bug Fixes
-
Fixed a bug causing a panic when multiple Goatfiles are passed and one or more of these files do not exist. Now, a proper error message is returned.
-
Fixed a bug which caused a panic when invalid key-value paris have been passed via the
--args
flag. [#49] -
When running with the
DEBUG
logging level, the parsed Goatfile is now only printed to log output if the--dry
flag is passed. -
Some command line parameters now got respective environment variables to set them. These are prefixed with
GOATARG_
and can be viewed in the--help
overview.
v0.15.0
New Features
-
A new template function
json
has been added which encodes any passed object into a JSON string (e.g.{{ json .myObject }}
). -
For each in-script logging function, a formatted equivalent has been added (e.g.
infof("Hello, %s!", "world")
).
Minor Changes and Bug Fixes
-
Variables set in the
PreScript
section are now available for substitution in all other parts of the request like URL, options, header, body or script. [#43] -
Section log lines are now hidden when a Goatfile is executed via the
execute
instruction. -
Some more debugging information has been added visible when using the
trace
log level.
v0.14.0
New Features
- A new builtin template function has been added called
isset
which takes a map as first parameter and a map key string as second parameter and returns true if the key is set in the map.
Minor Changes and Bug Fixes
-
Request conditions are now substituted and checked before continuing the request substitution (see #41).
-
The sections
Setup-Each
andTeardown-Each
have been removed (see #37). -
The
PreScript
block will now – as expected – also get substituted as same as theScript
section (see #35). -
When an array or map value gets substituted, the representation will now be in JSON format (see #36).
-
The execution status summary at the end of the end of the program execution does no more count log actions as requests and properly summs up request summaries from executed Goatfiles.
v0.13.1
v0.13.0
New Features
External Goatfile Execution [#32]
It is now possible to execute
a different Goatfile from within a Goatfile.
Here is a quick example.
execute ../doStuff (
username="{{.username}}"
password="{{.password}}"
n=1
) return (
response as response1
)
Executed Goatfiles are ran in a completely separate state with the parameters specified passed in and values captured which are listed in the return
statement.
More detials to the implementation can be found here.
Minor Changes and Bug Fixes
- It is now possible to substitute file descriptors with parameters (e.g.
@../{{.fileName}}
).
v0.12.0
New Features
Visual Studio Code Extension
There is now a prototype VSCode extension adding simple language support like syntax highlighting for Goatfiles. 🎉 🥳
Feel free to check it out here: https://github.com/studio-b12/goat-vscode.
Logical Section Logging [#28]
The beginning of the processing of a "logical" section (like Setup
, Test
and Teardown
) is now represented in the log output in the same way as context sections are.
Therefore, you don't need to write work around like stuff like the following to visually separate between Goatfile sections.
### Tests
##### Tests
// ...
An example output would look like the following.
More detailed debugg logging [#29]
When debug logging is enabled (log level of 6
or higher), detailed information about the outgoing request as well as the incoming response is provided in the log. Therefore, you don't need to add a debug(response)
to your [Script]
field in your Goatfiles anymore.
Bug Fixes
v0.11.0
New Features
Request Defaults [#13]
You can now specify default values for requests which will be applied to each request in the batch when not specified on the request.
Example:
### Defaults
[Header]
Content-Type: application/json
Accept: application/json
[Script]
assert(response.StatusCode === 200,
`Status Code was ${response.StatusCode}`);
### Tests
POST {{.instance}}/objects
[Body]
{
"name": "Cult of the Lamb",
"data": {
"publisher": "Devolver Digital",
"developer": "Massive Monster",
"released": "2022-08-11T00:00:00Z",
"tags": ["Base Building", "Roguelite", "Character Customization"],
"age_rating": "0"
}
}
---
// ...
Line of Request in Error Logs [#7]
The file and line where a failed request has been defined is now printed into the log output for a better debugging experience.
Example:
./test.goat
GET https://github.com
[Script]
assert(response.StatusCode === 404);
goat test.goat
Bug Fixes
- Fixed a bug where more than 3 dashes (
-
) as section delimiters after a raw block failed the parsing. - Removed unnecessary terminal outputs.
v0.10.0
v0.9.0
v0.8.0
Warning
The option name[Headers]
is now deprecated and support will be removed in release v1.0.0! Please use[Header]
as option name instead!Originally, the support for both
Header
andHeaders
as name for the headers option block has been added to avoid errors because both terms have been used somewhat interchangably in the past. But because we want the specification of Goatfiles to be as specific as possible, this support will now be dropped before the official release.
- The definition of the same block multiple times in the same request will now fail the parsing step with an error message alike the following. [#19]
2023-03-20T09:35:53Z FATAL execution failed error="failed parsing goatfile at test/test.goat:14:9: [script]: the section has been already defined"
- Allow passing multiple Goatfile locations as positional argument. [#21]
- Fixed a bug where the wrong files were listed on batch error.