test pokt on GH and gitea

test-pokt
zramsay 2023-06-05 19:45:05 -04:00
parent 32f8d65bb8
commit d493154d6a
3 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,40 @@
name: Fixturenet Pocket Test
on:
pull_request:
branches: '*'
push:
branches:
- main
- ci-test
- test-pokt
# Needed until we can incorporate docker startup into the executor container
env:
DOCKER_HOST: unix:///var/run/dind.sock
jobs:
test:
name: "Run basic test suite"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: "Install Python"
uses: cerc-io/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install shiv"
run: pip install shiv
- name: "Generate build version file"
run: ./scripts/create_build_tag_file.sh
- name: "Build local shiv package"
run: ./scripts/build_shiv_package.sh
- name: Start dockerd # Also needed until we can incorporate into the executor
run: |
dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5
- name: "Run test"
run: ./tests/fixturenet-pocket/run-pocket-test.sh

View File

@ -0,0 +1,40 @@
name: Fixturenet Pocket Test
on:
pull_request:
branches: '*'
push:
branches:
- main
- ci-test
- test-pokt
# Needed until we can incorporate docker startup into the executor container
env:
DOCKER_HOST: unix:///var/run/dind.sock
jobs:
test:
name: "Run basic test suite"
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: "Install Python"
uses: cerc-io/setup-python@v4
with:
python-version: '3.8'
- name: "Print Python version"
run: python3 --version
- name: "Install shiv"
run: pip install shiv
- name: "Generate build version file"
run: ./scripts/create_build_tag_file.sh
- name: "Build local shiv package"
run: ./scripts/build_shiv_package.sh
- name: Start dockerd # Also needed until we can incorporate into the executor
run: |
dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5
- name: "Run test"
run: ./tests/fixturenet-pocket/run-pocket-test.sh

View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
fi
# Set the stack
STACK=fixturenet-pocket
# Dump environment variables for debugging
echo "Environment variables:"
env
# Basic simple test of stack-orchestrator functionality
echo "Running stack-orchestrator smoke test"
# Bit of a hack, test the most recent package
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
# Set a non-default repo dir
export CERC_REPO_BASE_DIR=~/stack-orchestrator-test/repo-base-dir
echo "Testing this package: $TEST_TARGET_SO"
echo "Test version command"
reported_version_string=$( $TEST_TARGET_SO version )
echo "Version reported is: ${reported_version_string}"
echo "Cloning repositories into: $CERC_REPO_BASE_DIR"
rm -rf $CERC_REPO_BASE_DIR
mkdir -p $CERC_REPO_BASE_DIR
# Pull the stack
$TEST_TARGET_SO --stack $STACK setup-repositories
# Build the stack
$TEST_TARGET_SO --stack $STACK build-containers
echo "Images in the local registry:"
docker image ls -a
# Deploy the test container
$TEST_TARGET_SO --stack $STACK deploy up
# Clean up
$TEST_TARGET_SO --stack $STACK deploy down
echo "Test passed"