Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging the account manager into the plugin #134

Closed
wants to merge 4 commits into from
Closed
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
3 changes: 1 addition & 2 deletions .github/workflows/test-py39-functional-microshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
PYTHONWARNINGS: ignore
KUBECONFIG: ${{ github.workspace }}/kubeconfig
ACCT_MGT_VERSION: "6012025c247ab25fb2cab3be9ad06080e28713ee"

jobs:
build:
Expand All @@ -35,7 +34,7 @@ jobs:
run: |
bash ./ci/setup-oc-client.sh

- name: Install Microshift
- name: Install Microshift and add service account
run: |
./ci/microshift.sh

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-py39-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ jobs:
- name: Run functional tests
run: |
./ci/run_unit_tests.sh
pytest ./src/coldfront_plugin_cloud/tests/unit/moc_openshift/ -v --cov=acct_mgt --cov-report=term
26 changes: 0 additions & 26 deletions ci/devstack-test-oidc.py

This file was deleted.

13 changes: 2 additions & 11 deletions ci/microshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,5 @@ while ! oc get route -A; do
done
echo "::endgroup::"

# Install OpenShift Account Management
git clone "${ACCT_MGT_REPOSITORY}" "$test_dir/openshift-acct-mgt"
git -C "$test_dir/openshift-acct-mgt" config advice.detachedHead false
git -C "$test_dir/openshift-acct-mgt" checkout "$ACCT_MGT_VERSION"

echo "::group::Deploy openshift-acct-mgt"
oc apply -k "$test_dir/openshift-acct-mgt/k8s/overlays/crc"
oc wait -n onboarding --for=condition=available --timeout=800s deployment/onboarding
echo "::endgroup::"

sleep 60
oc create sa coldfront
oc adm policy add-cluster-role-to-user cluster-admin system:serviceaccount:default:coldfront
9 changes: 5 additions & 4 deletions ci/run_functional_tests_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
# Tests expect the resource to be name Devstack
set -xe

export OPENSHIFT_MICROSHIFT_USERNAME="admin"
export OPENSHIFT_MICROSHIFT_PASSWORD="pass"

if [[ ! "${CI}" == "true" ]]; then
source /tmp/coldfront_venv/bin/activate
fi

export DJANGO_SETTINGS_MODULE="local_settings"
export FUNCTIONAL_TESTS="True"
export OS_AUTH_URL="https://onboarding-onboarding.cluster.local"

export OS_AUTH_URL="https://onboarding-onboarding.cluster.local:6443"
export ACCT_MGT_IDENTITY_PROVIDER=developer #TODO: Replace this with resource attribute instead

export OPENSHIFT_MICROSHIFT_TOKEN="$(oc create token coldfront)"

coverage run --source="." -m django test coldfront_plugin_cloud.tests.functional.openshift
coverage report
4 changes: 0 additions & 4 deletions ci/run_functional_tests_openstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ fi
export DJANGO_SETTINGS_MODULE="local_settings"
export FUNCTIONAL_TESTS="True"
export OS_AUTH_URL="http://$HOST_IP/identity"
export KEYCLOAK_URL="http://$HOST_IP:8080"
export KEYCLOAK_USER="admin"
export KEYCLOAK_PASS="nomoresecret"
export KEYCLOAK_REALM="master"

coverage run --source="." -m django test coldfront_plugin_cloud.tests.functional.openstack
coverage report
Expand Down
4 changes: 3 additions & 1 deletion ci/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ fi

export DJANGO_SETTINGS_MODULE="local_settings"

coverage run --source="." -m django test coldfront_plugin_cloud.tests.unit
coverage run --source="." -a -m django test coldfront_plugin_cloud.tests.unit.test_attribute_migration
coverage run --source="." -a -m django test coldfront_plugin_cloud.tests.unit.test_calculate_quota_unit_hours
coverage run --source="." -a -m django test coldfront_plugin_cloud.tests.unit.test_utils
coverage report
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ python-memcached==1.59
python-novaclient
python-neutronclient
python-swiftclient
python-dotenv
gunicorn
kubernetes
openshift
Empty file.
Loading
Loading