Skip to content

Commit

Permalink
Adding integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavez committed May 20, 2024
1 parent 1c102ab commit 17cb8a0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,30 @@ jobs:
if: always()
uses: guyarb/[email protected]
with:
test-results: test.json
test-results: test.json

test:
runs-on: ubuntu-latest
env:
BATON_LOG_LEVEL: debug
# Add any environment variables needed to run baton-bitbucket-datacenter
BATON_API_TOKEN: ${{ secrets.BATON_API_TOKEN }}
BATON_DOMAIN: ${{ secrets.BATON_DOMAIN }}
# The following parameters are passed to grant/revoke commands
CONNECTOR_GRANT: 'group:778441812670942:member:user:5346803201281760'
CONNECTOR_ENTITLEMENT: 'group:778441812670942:member'
CONNECTOR_PRINCIPAL_TYPE: 'user'
CONNECTOR_PRINCIPAL: '5346803201281760'
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v4
- name: Install baton
run: ./scripts/get-baton.sh && mv baton /usr/local/bin
- name: Build baton-okta
run: go build ./cmd/baton-okta
- name: Run baton-okta
run: ./baton-okta --api-token ${{ env.BATON_API_TOKEN }} --domain ${{ env.BATON_DOMAIN }}
19 changes: 19 additions & 0 deletions pkg/scripts/get-baton.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euxo pipefail

OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
if [ "${ARCH}" = "x86_64" ]; then
ARCH="amd64"
fi

RELEASES_URL="https://api.github.com/repos/conductorone/baton/releases/latest"
BASE_URL="https://github.com/conductorone/baton/releases/download"

DOWNLOAD_URL=$(curl "${RELEASES_URL}" | jq --raw-output ".assets[].browser_download_url | match(\"${BASE_URL}/v[.0-9]+/baton-v[.0-9]+-${OS}-${ARCH}.*\"; \"i\").string")

FILENAME=$(basename ${DOWNLOAD_URL})

curl -LO ${DOWNLOAD_URL}
tar xzf ${FILENAME}

0 comments on commit 17cb8a0

Please sign in to comment.