test more tools: gcloud, hub, coreutils, brunch

This commit is contained in:
localstepdo 2020-04-16 10:18:24 -07:00
parent acd5de95cf
commit e1dbdca365
6 changed files with 31 additions and 15 deletions

View File

@ -20,7 +20,7 @@ RUN apk add --no-cache \
emacs=26.3-r2 \
file=5.37-r1 \
gcc=9.2.0-r4 \
git=2.24.1-r0 \
git=2.24.2-r0 \
go=1.13.4-r1 \
gradle=5.6.4-r0 \
httpie=1.0.3-r1 `# http=1.0.3` \
@ -48,7 +48,17 @@ RUN apk add --no-cache \
zip=3.0-r7 \
zsh=5.7.1-r0; \
\
npm install -g brunch@"=3.0.0"; \
\
gcloud=289.0.0; \
curl -L "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${gcloud}-linux-x86_64.tar.gz" | tar xz; \
\
# bats=1.2.0
commit="87b16eb"; \
curl -L "https://github.com/bats-core/bats-core/tarball/${commit}" | tar xz; \
"bats-core-bats-core-${commit}/install.sh" /usr/local
"bats-core-bats-core-${commit}/install.sh" /usr/local; \
\
hub=2.14.2; \
curl -L "https://github.com/github/hub/releases/download/v${hub}/hub-linux-386-${hub}.tgz" | tar xz
ENV PATH /hub-linux-386-${hub}/bin:/google-cloud-sdk/bin:$PATH

View File

@ -6,6 +6,7 @@ FROM ubuntu:bionic-20200311
# awk
# bash=4.4.20
# bzip2=1.0.6
# gnu_coreutils=8.28
# grep=3.1
# gzip=1.6
# perl=26
@ -68,10 +69,15 @@ RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install --no-inst
zsh=5.4.2* \
&& apt-get -y autoremove && apt-get -y clean && rm -rf /var/lib/apt/lists/*; \
\
gcloud=289.0.0; \
curl -L "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${gcloud}-linux-x86_64.tar.gz" | tar xz; \
\
# bats=1.2.0
commit="87b16eb"; \
curl -L "https://github.com/bats-core/bats-core/tarball/${commit}" | tar xz; \
"bats-core-bats-core-${commit}/install.sh" /usr/local; \
\
# hub=2.14.2
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.2
hub=2.14.2; \
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s ${hub}
ENV PATH /google-cloud-sdk/bin:$PATH

View File

@ -3,25 +3,28 @@ apt
apt-get
aptitude
# gnu_coreutils shows as installed, but is not on alpine.
# todo: We should change the command we use for this to
# something busybox doesn't also implement. Examples:
# chcon, csplit, dir, dircolors, fmt, join, logname, pathchk,
# pinky, pr, ptx, runcon, stdbuf, tsort, users, vdir, who
gnu_coreutils
# todo: add to test container
ag
ant
autojump
aws
brew
brunch
code
eb
gcloud
gem
gnu_coreutils
gor
groovy
grunt
gulp
has
heroku
hub
java
javac
kotlin
@ -47,6 +50,7 @@ awk
bzip2
grep
gzip
hub
wget
xz

View File

@ -2,8 +2,6 @@
brunch
code
eb
gcloud
gnu_coreutils
go
gor
has

View File

@ -3,14 +3,14 @@
cd $BATS_TEST_DIRNAME
distro="alpine"
if command -v apt-get 2>&1 >/dev/null; then
if grep -iq "ubuntu" /etc/issue; then
distro="ubuntu"
fi
SKIP_FILE=packages_${distro}_skip.txt
DOCKER_FILE=./containers/${distro}.Dockerfile
expected_version() {
grep -Eo "( |#)${1}=[^\` *-]+" $DOCKER_FILE | tr "=" "\n" | tr ":" "\n" | tail -1
grep -Eo "( |#)${1}(|@\")=[^\`\"; *-]+" $DOCKER_FILE | tr "=" "\n" | tr ":" "\n" | tail -1
}
@test "test each package individually and verify version" {

View File

@ -8,8 +8,6 @@ get_version_from_has() {
@test "test $package" {
# Ensure inputs
[ -n "$package" ]
[ -n "$expected_ver" ]
[ "$(echo "${package}" | wc -w)" -eq 1 ]
[ "$(echo "${expected_ver}" | wc -w)" -eq 1 ]
@ -23,7 +21,7 @@ get_version_from_has() {
run get_version_from_has "$output"
if [ "$status" -eq 0 ]; then
actual_ver="$output"
[ -n "$actual_ver" ]
[ "$(echo "${actual_ver}" | wc -w)" -eq 1 ]
fi
# Compare expected with actual