Skip to content

Dependency problems with the yq command #50

Open
@dverite

Description

@dverite

The bats test suite uses yq to manipulate yaml files (it's like jq but knowing the yaml format).

It's mentioned in CONTRIBUTING.md with brew install yq as the command.

It should be noted that there are different yq packages:

Ubuntu 23 or newer ship an yq package with an yq command that is a Python wrapper on top of jq. It can also be installed with pip3 install yq. With this flavor of yq, the bats test suite fails with a syntax error on the first yq invocation. The version reported by yq --version is: yq 3.4.3

There is another yq project written in Go (github page) which is what the bats test suite expects. For that one, yq --version reports:

yq (https://github.com/mikefarah/yq/) version v4.44.3

To install the "correct" yq on Linux Ubuntu:

The dependency on yq is mentioned in:

  • scripts/bats/test/libs/dependencies.bash : apk add yq
  • scripts/localdev/configuration/bats/Dockerfile: RUN apk add postgresql-client yq

Indeed Alpine Linux provides an yq package except that it exists in the v3.15 branch, but not in the more recent branches. These have two distinct yq-go and yq-python packages.

It probably implies that apk add yq will fail to work with more recent Alpine versions.

I suggest to get rid of the yq dependency if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions