Skip to content

Commit

Permalink
Issue #19: first cut adding .stone tests to github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
dalehenrich committed Sep 6, 2021
1 parent 99fdf41 commit 0f6f879
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml → .github/workflows/solo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
curl -L "https://github.com/kward/shunit2/archive/refs/tags/v2.1.8.tar.gz" | tar zx -C ${GITHUB_WORKSPACE}/shunit_tests
ls -l ${GITHUB_WORKSPACE}/gemstone/gs
pushd ${GITHUB_WORKSPACE}/gemstone/gs
${GITHUB_WORKSPACE}/dev/downloadGemStone.sh ${GS_VERS}
${GITHUB_WORKSPACE}/dev/downloadSoloGemStone.sh ${GS_VERS}
curl -L -O -s -S "https://github.com/dalehenrich/superDoit/releases/download/v0.1.0/${GS_VERS}_extent0.solo.dbf.gz"
gunzip --stdout ${GS_VERS}_extent0.solo.dbf.gz > extent0.solo.dbf
chmod -w extent0.solo.dbf
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/stone_361.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
pull_request:
schedule:
- cron: "15 2 21 * *" #run job on the 21st day of every month on the 15th minute of the 2nd hour


jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04, macos-10.15 ]
gsvers: [ 3.6.1 ]
runs-on: ${{ matrix.os }}
env:
GS_VERS: ${{ matrix.gsvers }}
PLATFORM: ${{ matrix.os }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# download the $GS_VERS product tree
- name: setup
run: |
# set -x
curl -L "https://github.com/kward/shunit2/archive/refs/tags/v2.1.8.tar.gz" | tar zx -C ${GITHUB_WORKSPACE}/shunit_tests
pushd ${GITHUB_WORKSPACE}/tests/products
${GITHUB_WORKSPACE}/dev/downloadGemStone.sh ${GS_VERS}
echo "GEMSTONE=$GEMSTONE"
popd
. ${GITHUB_WORKSPACE}/dev/defPath.env
- name: test
run: |
shunit_tests/testExamples.stone
slack-workflow-status:
if: always()
name: Post Workflow Status To Slack
needs:
- build
runs-on: ubuntu-18.04
steps:
- name: Slack Workflow Notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_DALEHENRICH}}
name: 'action run'
1 change: 1 addition & 0 deletions dev/defPath.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# will resolve correctly
#
pushd "$( dirname "${BASH_SOURCE[0]}" )"
# poor man's realpath
cd ..
export PATH="`pwd`/bin":$PATH
export PATH="`pwd`/scriptBin":$PATH
Expand Down
6 changes: 3 additions & 3 deletions dev/downloadGemStone.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /usr/bin/env bash

vers="$1"
echo "installing GemStone version $vers as .solo product tree"
echo "installing GemStone version $vers in `pwd`"
set -x
if [ "$PLATFORM" = "macos-10.15" ] ; then
name=GemStone64Bit${vers}-i386.Darwin
Expand All @@ -12,11 +12,11 @@ if [ "$PLATFORM" = "macos-10.15" ] ; then
attach_path=`echo $attach_result | xpath "//dict/array/dict[true]/key[.='mount-point']/following-sibling::string[1]/text()" 2>/dev/null`
cp -R "${attach_path}/${gsvers}/${name}" .
hdiutil detach ${attach_device}
export GEMSTONE="`pwd`/$name"
else
name=GemStone64Bit${vers}-x86_64.Linux
zipfile=${name}.zip
curl -O -s -S https://downloads.gemtalksystems.com/pub/GemStone64/${vers}/$zipfile
unzip -q $zipfile
export GEMSTONE="`pwd`/$name"
fi
ln -s $name product

8 changes: 8 additions & 0 deletions dev/downloadSoloGemStone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /usr/bin/env bash
vers="$1"
${GITHUB_WORKSPACE}/dev/downloadGemStone.sh $vers
if [ "$PLATFORM" = "macos-10.15" ] ; then
ln -s GemStone64Bit${vers}-i386.Darwin product
else
ln -s GemStone64Bit${vers}-x86_64.Linux product
fi``
38 changes: 38 additions & 0 deletions shunit_tests/testExamples.stone
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /usr/bin/env bash

. ${GITHUB_WORKSPACE}/dev/defPath.env

PATH=${GITHUB_WORKSPACE}/examples/simple:$PATH

test_errorWithHelp_solo() {
# run without error
errorWithHelp.stone -h
errorWithHelp.stone --help
}

test_simplest_solo() {
# run without error
seven=`simplest.stone`
assertEquals "wrong answer" '7' "${seven}"
simplest.stone -h
simplest.stone --help
simplest.stone -D
simplest.stone --debug
}

test_simpleArgs_1_stone() {
# run without error
seven=`simpleArgs.stone --addend=4`
assertEquals "wrong answer" '7' "${seven}"
}

test_simpleArgs_2_stone() {
# run without error
seven=`simpleArgs.stone -a 4`
assertEquals "wrong answer" '7' "${seven}"
}

. shunit_tests/shunit2-2.1.8/shunit2_test_helpers
. shunit_tests/shunit2-2.1.8/shunit2


3 changes: 3 additions & 0 deletions tests/products/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!README.md
!.gitignore
1 change: 1 addition & 0 deletions tests/products/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Primarily used for testing, but a convenient place to stash your gemstone product trees if you are not using GsDevKit_home.

0 comments on commit 0f6f879

Please sign in to comment.