-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added basic tests and an auto option to the assistant
- Loading branch information
Showing
7 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
schedule: | ||
- cron: '00 07 * * *' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: Debug with tmate | ||
required: false | ||
default: false | ||
|
||
# This is required for "gautamkrishnar/keepalive-workflow", see "ddev/github-action-add-on-test" | ||
permissions: | ||
actions: write | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
ddev_version: [stable, HEAD] | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run ShellCheck | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: "scripts,commands" | ||
|
||
- uses: ddev/github-action-add-on-test@v2 | ||
with: | ||
ddev_version: ${{ matrix.ddev_version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
debug_enabled: ${{ github.event.inputs.debug_enabled }} | ||
addon_repository: ${{ env.GITHUB_REPOSITORY }} | ||
addon_ref: ${{ env.GITHUB_REF }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
#!/bin/bash | ||
|
||
#ddev-generated | ||
|
||
## Description: Create symlinks to the scripts provided by Scripthor. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
setup() { | ||
set -eu -o pipefail | ||
export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." | ||
export TESTDIR=~/tmp/test-addon-backstopjs | ||
mkdir -p $TESTDIR | ||
export PROJNAME=test-addon-backstopjs | ||
export DDEV_NON_INTERACTIVE=true | ||
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true | ||
cd "${TESTDIR}" | ||
ddev config --project-name=${PROJNAME} | ||
ddev start -y >/dev/null | ||
} | ||
|
||
teardown() { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) | ||
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 | ||
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} | ||
} | ||
|
||
@test "install from directory" { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} | ||
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 | ||
ddev get ${DIR} | ||
ddev restart | ||
} | ||
|
||
@test "install from release" { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) | ||
echo "# ddev get drud/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 | ||
ddev get drud/ddev-addon-template | ||
ddev restart >/dev/null | ||
# Do something useful here that verifies the add-on | ||
} |
Empty file.