Skip to content

Commit

Permalink
add 2023 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Apr 29, 2023
1 parent 957c54a commit 28e1946
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ env:

jobs:
tests:
uses: ./.github/workflows/tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

name: Tests
runs-on: ubuntu-20.04
env:
Expand All @@ -36,7 +40,7 @@ jobs:

- name: Setup CommandBox
uses: elpete/[email protected]


- name: Setup Elasticsearch
run: |
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Test Suites

# We are a reusable Workflow only
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true

jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
env:
ELASTICSEARCH_PROTOCOL: http
ELASTICSEARCH_HOST: 127.0.0.1
ELASTICSEARCH_PORT: 9200
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
cfengine: [ "lucee@5", "adobe@2018", "adobe@2021" ]
ELASTICSEARCH_VERSION: [ "7.17.8", "8.6.1" ]
experimental: [false]
include:
- cfengine: "adobe@2023"
ELASTICSEARCH_VERSION: "8.6.1"
experimental: true
steps:
- name: Checkout Repository
uses: actions/[email protected]

- name: Setup Java
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "11"

- name: Setup CommandBox CLI
uses: Ortus-Solutions/[email protected]

- name: Install Dependencies
run: |
box run-script harness:install
- name: Install Node 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Compile Release Static assets
run: |
npm install && npm run prod
cd $GITHUB_WORKSPACE
- name: Setup Elasticsearch
run: |
docker run -d -p "${{ env.ELASTICSEARCH_PORT }}:9200" -v $PWD/build/resources/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml elasticsearch:${{ matrix.ELASTICSEARCH_VERSION }}
rm -rf test-harness/modules_app
- name: Start ${{ matrix.cfengine }} Server
env:
ENVIRONMENT: development
run: |
cd test-harness
box server start serverConfigFile="server-${{ matrix.cfengine }}.json" --noSaveSettings --debug
cd ../
curl http://127.0.0.1:60299
- name: Run Tests
env:
ENVIRONMENT: development
run: |
mkdir -p test-harness/tests/results
box package set testbox.runner="http://127.0.0.1:60299/tests/runner.cfm?seed=true"
box testbox run --verbose outputFile=test-harness/tests/results/test-results outputFormats=json,antjunit
ls -lR test-harness/tests
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: test-harness/tests/results/**/*.xml
check_name: "${{ matrix.cfengine }} Test Results"

- name: Upload Test Results to Artifacts
if: always()
uses: actions/[email protected]
with:
name: test-results-${{ matrix.cfengine }}
path: |
test-harness/tests/results/**/*
- name: Failure Debugging Log
if: ${{ failure() }}
run: |
cd test-harness
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
cd ../
- name: Upload Debugging Log To Artifacts
if: ${{ failure() }}
uses: actions/[email protected]
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
test-harness/.engine/**/logs/*
test-harness/.engine/**/WEB-INF/cfusion/logs/*
- name: Slack Notifications
# Only on failures and NOT in pull requests
if: ${{ failure() && !startsWith( 'pull_request', github.event_name ) }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: coding
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: '${{ github.repository }} tests failed :cry:'
SLACK_TITLE: ${{ github.repository }} Tests For ${{ matrix.cfengine }} failed
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
23 changes: 23 additions & 0 deletions test-harness/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name":"logstash-adobe@2023",
"app":{
"serverHomeDirectory":"./.engine/adobe2023",
"cfengine":"[email protected]"
},
"web":{
"http":{
"port":"60299"
},
"rewrites":{
"enable":"true"
},
"aliases":{
"/moduleroot/stachebox/includes":"../includes",
"/stachebox/includes":"../includes"
}
},
"openBrowser":"false",
"scripts":{
"onServerInstall":"cfpm install zip,document,feed"
}
}

0 comments on commit 28e1946

Please sign in to comment.