Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/chart-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
version: "v3.19.2"

- name: Install helm unittest plugin
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.0.0
run: helm plugin install https://github.com/helm-unittest/helm-unittest.git --version v1.1.0

- name: Run chart unit tests
id: unittest
Expand Down Expand Up @@ -137,8 +137,21 @@ jobs:
if: steps.unittest.outcome == 'failure'
run: exit 1

detect-fork:
runs-on: ubuntu-latest
permissions: {}
outputs:
is-fork: ${{ steps.check.outputs.is-fork }}
steps:
- name: Check fork status
id: check
env:
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
run: echo "is-fork=$IS_FORK" >> "$GITHUB_OUTPUT"

install:
runs-on: ubuntu-latest-4x
needs: [detect-fork]
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down Expand Up @@ -178,6 +191,7 @@ jobs:
run: kubectl create namespace posit-test

- name: Create License File Secrets
if: needs.detect-fork.outputs.is-fork != 'true'
env:
PWB_LICENSE: ${{ secrets.PWB_LICENSE_FILE }}
PCT_LICENSE: ${{ secrets.PCT_LICENSE_FILE }}
Expand All @@ -201,16 +215,32 @@ jobs:
# no allow-failure until https://github.com/actions/toolkit/issues/399
- name: Run chart-testing (install changed)
id: ct-install
if: ${{ github.ref != 'refs/heads/main' && steps.list-changed.outputs.changed == 'true' }}
if: ${{ github.ref != 'refs/heads/main' && steps.list-changed.outputs.changed == 'true' && needs.detect-fork.outputs.is-fork != 'true' }}
run: ct install --target-branch main --chart-dirs charts --chart-dirs other-charts --excluded-charts rstudio-library,rstudio-library-test --namespace posit-test
continue-on-error: true

# no allow-failure until https://github.com/actions/toolkit/issues/399
- name: Run chart-testing (install all)
id: ct-install-all
if: needs.detect-fork.outputs.is-fork != 'true'
run: ct install --target-branch main --all --chart-dirs charts --chart-dirs other-charts --excluded-charts rstudio-library,rstudio-library-test --namespace posit-test
continue-on-error: true

# Fork PRs have no access to license secrets. replicas=0 causes Kubernetes to
# create all non-pod resources (Services, RBAC, ConfigMaps, PVCs) and consider
# the Deployment immediately rolled out — no pod is scheduled that needs the license.
- name: Run chart-testing (install changed, fork)
id: ct-install-fork
if: ${{ github.ref != 'refs/heads/main' && steps.list-changed.outputs.changed == 'true' && needs.detect-fork.outputs.is-fork == 'true' }}
run: ct install --target-branch main --chart-dirs charts --chart-dirs other-charts --excluded-charts rstudio-library,rstudio-library-test --namespace posit-test --helm-extra-set-args "--set=replicas=0"
continue-on-error: true

- name: Run chart-testing (install all, fork)
id: ct-install-all-fork
if: needs.detect-fork.outputs.is-fork == 'true'
run: ct install --target-branch main --all --chart-dirs charts --chart-dirs other-charts --excluded-charts rstudio-library,rstudio-library-test --namespace posit-test --helm-extra-set-args "--set=replicas=0"
continue-on-error: true

- name: Notify Slack of chart install failure if on main
if: github.ref == 'refs/heads/main' && (steps.ct-install.outcome == 'failure' || steps.ct-install-all.outcome == 'failure')
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
Expand All @@ -233,7 +263,7 @@ jobs:
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

- name: Fail the workflow if failed installs
if: steps.ct-install.outcome == 'failure' || steps.ct-install-all.outcome == 'failure'
if: steps.ct-install.outcome == 'failure' || steps.ct-install-all.outcome == 'failure' || steps.ct-install-fork.outcome == 'failure' || steps.ct-install-all-fork.outcome == 'failure'
run: exit 1

check-versions-connect:
Expand Down
4 changes: 2 additions & 2 deletions charts/posit-chronicle/tests/configmap_fail_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ tests:
ServiceLogLevel: INVALID
asserts:
- failedTemplate:
errorPattern: ".*ServiceLogLevel: Does not match pattern.*"
errorPattern: "(?i).*ServiceLogLevel.*does not match pattern.*"
- it: should fail for invalid log level values
set:
config:
Logging:
ServiceLogFormat: INVALID
asserts:
- failedTemplate:
errorPattern: ".*ServiceLogFormat: Does not match pattern.*"
errorPattern: "(?i).*ServiceLogFormat.*does not match pattern.*"
- it: should fail if S3 is enabled but no bucket is specified
set:
config:
Expand Down
Loading