Skip to content

Commit

Permalink
Try creating superadmin user
Browse files Browse the repository at this point in the history
  • Loading branch information
soapy1 committed Feb 6, 2025
1 parent 508372c commit 9677013
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions .github/workflows/test_local_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Create example-user
working-directory: ${{ steps.init.outputs.directory }}
run: |
nebari keycloak adduser --user "${TEST_USERNAME}" "${TEST_PASSWORD}" --config ${{ steps.init.outputs.config }}
nebari keycloak adduser --user "${TEST_USERNAME}" "${TEST_PASSWORD}" --config ${{ steps.init.outputs.config }} --groups superadmin
nebari keycloak listusers --config ${{ steps.init.outputs.config }}
- name: Await Workloads
Expand All @@ -112,18 +112,18 @@ jobs:
max-restarts: 3

### DEPLOYMENT TESTS
- name: Deployment Pytests
env:
NEBARI_CONFIG_PATH: ${{ steps.init.outputs.config }}
KEYCLOAK_USERNAME: ${{ env.TEST_USERNAME }}
KEYCLOAK_PASSWORD: ${{ env.TEST_PASSWORD }}
run: |
pytest tests/tests_deployment/ -v -s
# - name: Deployment Pytests
# env:
# NEBARI_CONFIG_PATH: ${{ steps.init.outputs.config }}
# KEYCLOAK_USERNAME: ${{ env.TEST_USERNAME }}
# KEYCLOAK_PASSWORD: ${{ env.TEST_PASSWORD }}
# run: |
# pytest tests/tests_deployment/ -v -s

### USER-JOURNEY TESTS
- uses: actions/setup-node@v4
with:
node-version: 20
# ### USER-JOURNEY TESTS
# - uses: actions/setup-node@v4
# with:
# node-version: 20

# - name: Playwright Tests
# env:
Expand Down Expand Up @@ -175,15 +175,13 @@ jobs:
- name: Get conda-store token from login
id: conda-store-token
env:
CONDA_STORE_BASE_URL: https://${{ steps.init.outputs.domain }}
KEYCLOAK_USERNAME: ${{ env.TEST_USERNAME }}
KEYCLOAK_PASSWORD: ${{ env.TEST_PASSWORD }}
CONDA_STORE_BASE_URL: https://${{ steps.init.outputs.domain }}
working-directory: ${{ steps.init.outputs.directory }}
run: |
cat ${{ steps.init.outputs.config }} | grep initial_root_password | cut -d ':' -f 2
INITIAL_ROOT_PWD=$(cat ${{ steps.init.outputs.config }} | grep initial_root_password | cut -d ':' -f 2 | awk '{$1=$1};1')
LOGIN_URL=$(curl -c /tmp/nebari-session --insecure -Ls ${CONDA_STORE_BASE_URL}/conda-store/login/\?next= | grep auth/realms/nebari/login-actions/authenticate | grep -oP '(?<=action=")([^"]+)' | sed 's/\&amp\;/\&/g')
curl -X POST --insecure -b /tmp/nebari-session -H "Content-Type: application/x-www-form-urlencoded" -vv --data '{"credentialId":"", "username": "root", "password": "${INITIAL_ROOT_PWD}"}' $LOGIN_URL
curl -X POST --insecure -b /tmp/nebari-session -H "Content-Type: application/x-www-form-urlencoded" -vv --data '{"credentialId":"", "username": "${KEYCLOAK_USERNAME}", "password": "${KEYCLOAK_PASSWORD}"}' $LOGIN_URL
echo "CONDA_STORE_TOKEN=$(curl --insecure -L -X POST -b /tmp/conda-store-cookie ${CONDA_STORE_BASE_URL}/conda-store/api/v1/token | jq --raw-output .data.token)" >> "$GITHUB_OUTPUT"
- name: Run conda-store-server user_journey tests
Expand Down

0 comments on commit 9677013

Please sign in to comment.