Skip to content

Commit

Permalink
ci: Update CI tests
Browse files Browse the repository at this point in the history
* Add a test for report API request

Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed May 1, 2024
1 parent 9f91c79 commit e766901
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,21 @@ jobs:
with:
version: latest
args: build

- name: Start grafana docker
run: yarn server -d

- name: Run e2e tests
run: yarn e2e
run: |
docker-compose up --build -d
sleep 10
yarn e2e
docker-compose down
- name: Stop grafana docker
run: docker-compose down
- name: Run API test
run: |
GF_AUTH_BASIC_ENABLED=true GF_AUTH_ANONYMOUS_ENABLED=false docker-compose up --build -d
sleep 10
# Generate report from API request using basic auth
curl -f -o report.pdf "http://admin:admin@localhost:3000/api/plugins/mahendrapaipuri-dashboardreporter-app/resources/report?dashUid=e472bbf0-140c-4852-a74b-1a4c32202659&from=now-5m&to=now&var-testvar0=0&var-testvar1=foo&var-testvar2=1"
docker-compose down
# Remove this once plugin review has been submitted
- name: Package plugin
Expand Down
8 changes: 6 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ services:
# - GF_LOG_LEVEL=debug
- GF_DATAPROXY_LOGGING=true
# allow anonymous admin so we don't have to set up a password to start testing
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=${GF_AUTH_ANONYMOUS_ENABLED:-true}
- GF_AUTH_BASIC_ENABLED=${GF_AUTH_BASIC_ENABLED:-false}
#- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
# skip login page
# - GF_AUTH_DISABLE_LOGIN_FORM=true
# We need to toggle external service accounts so that Grafana will get
# the token from a service account to read dashboards
- GF_FEATURE_TOGGLES_ENABLE=${GF_FEATURE_TOGGLES_ENABLE:-externalServiceAccounts}
# disable alerting because it vomits logs
- GF_ALERTING_ENABLED=false
- GF_UNIFIED_ALERTING_ENABLED=false
Expand Down

0 comments on commit e766901

Please sign in to comment.