Skip to content

Releases: studio-b12/goat

v1.0.0-beta.1

12 Dec 09:16
c4713a5
Compare
Choose a tag to compare

⚠️ Breaking Changes

  • The built-in template function base64url has been renamed to base64Url for better naming consistency. [#48]

  • The built-in template functions base64 and base64Url do now encode strings to Base64 with leading padding. If you want to encode without padding, use the new functions base64Unpadded and base64UrlUnpadded. [#48]

  • The previously deprecated alias headers for the header 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 the GOATARG_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

08 Nov 10:09
Compare
Choose a tag to compare

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

15 Aug 07:12
c815ace
Compare
Choose a tag to compare

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 and Teardown-Each have been removed (see #37).

  • The PreScript block will now – as expected – also get substituted as same as the Script 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

03 Aug 06:56
Compare
Choose a tag to compare

Minor Changes and Bug Fixes

  • Fixed a bug where an executed files location in a used file is looked for in the directory that uses the file and not the used file. [#39]
  • Fixed a bug in the errs package which, when using Join with an error type as target, overwrites the passed error.

v0.13.0

13 Jul 07:49
Compare
Choose a tag to compare

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

29 Jun 15:29
Compare
Choose a tag to compare

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

  • In v0.11.0, a feature has been added that the file and line of a request that failed is represented in the error message in the console ([#7]). There was a bug that faield reqeusts in imported files show up as being in the file which imports the file. This has been fixed now. [#30]

v0.11.0

10 May 14:45
Compare
Choose a tag to compare

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

06 Apr 09:28
Compare
Choose a tag to compare
  • Add [PreScript] request block. [#20]
  • Fix log section spacers and add color to them. 🎨

v0.9.0

05 Apr 08:30
Compare
Choose a tag to compare
  • Added Log Sections [#23]

v0.8.0

24 Mar 13:19
fc8f163
Compare
Choose a tag to compare

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 and Headers 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.