Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env var expansion feature in commandTests output assertions #388

Open
hightoxicity opened this issue Oct 20, 2023 · 0 comments
Open

Env var expansion feature in commandTests output assertions #388

hightoxicity opened this issue Oct 20, 2023 · 0 comments

Comments

@hightoxicity
Copy link

Hi,

Would it be possible to get some env var expansion in output assertions of commandTests?

schemaVersion: 2.0.0

fileExistenceTests:
- name: 'Go Binary is present and executable'
  path: '/usr/local/go/bin/go'
  shouldExist: true
  permissions: '-rwxr-xr-x'
  isExecutableBy: 'root'
  uid: 0
  gid: 0

commandTests:
- name: 'Go version cmd to check go version'
  command: 'go'
  args: ['version']
  expectedOutput: ['^go version go${GO_VERSION}.+$']

The associated container build spec is following one:

ARG BASE_VERSION
FROM docker.something.com/base-build:${BASE_VERSION}

USER root

ARG GOLANG_VERSION=1.21.3
ARG DEBIAN_FRONTEND=noninteractive

ENV GOPROXY https://artifactory.something.com/artifactory/go-remote/
ENV GONOSUMDB github.something.com/*
ENV PATH /usr/local/go/bin:${PATH}
ENV GOPATH /go
ENV GOLANG_VERSION=${GOLANG_VERSION}

RUN mkdir -p ${GOPATH} && \
    curl "https://artifactory.something.com/artifactory/go-linux-remote/go${GOLANG_VERSION}.linux-amd64.tar.gz" --output /tmp/go.tar.gz && \
    rm -rf /usr/local/go && tar -C /usr/local -xzf /tmp/go.tar.gz && \
    rm /tmp/go.tar.gz

ARG GIT_SHA
ARG GIT_BRANCH

CMD ["/bin/bash"]

Thx for your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant