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
4 changes: 1 addition & 3 deletions .github/workflows/test-functional-microstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:

- name: Install ColdFront and plugin
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
pip install -e .
./ci/setup.sh

- name: Install and start Ceph RadosGW
run: |
Expand Down
1 change: 1 addition & 0 deletions ci/run_functional_tests_openshift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export DJANGO_SETTINGS_MODULE="local_settings"
export FUNCTIONAL_TESTS="True"
export OS_API_URL="https://onboarding-onboarding.cluster.local:6443"
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
export DB_URL="postgres://postgres:postgres@localhost:5432/postgres"


coverage run --source="." -m django test coldfront_plugin_cloud.tests.functional.openshift
Expand Down
1 change: 1 addition & 0 deletions ci/run_functional_tests_openstack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export DJANGO_SETTINGS_MODULE="local_settings"
export FUNCTIONAL_TESTS="True"
export OS_AUTH_URL="https://localhost:5000"
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
export DB_URL="postgres://postgres:postgres@localhost:5432/postgres"

coverage run --source="." -m django test coldfront_plugin_cloud.tests.functional.openstack
coverage run --source="." -m django test coldfront_plugin_cloud.tests.functional.esi
Expand Down
1 change: 1 addition & 0 deletions ci/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ if [[ ! "${CI}" == "true" ]]; then
fi

export DJANGO_SETTINGS_MODULE="local_settings"
export DB_URL="postgres://postgres:postgres@localhost:5432/postgres"

coverage run --source="." -m django test coldfront_plugin_cloud.tests.unit
coverage report
3 changes: 3 additions & 0 deletions ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -xe

sudo systemctl start postgresql.service
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"

# If running on Github actions, don't create a virtualenv
if [[ ! "${CI}" == "true" ]]; then
virtualenv -p python3 /tmp/coldfront_venv
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import uuid
import tempfile

from django.db import connection
from django.core.management import call_command
from coldfront.core.project.models import Project
from coldfront.core.field_of_science.models import FieldOfScience
Expand All @@ -9,6 +10,17 @@


class TestFixAllocation(base.TestBase):
def setUp(self) -> None:
"""
Because Coldfront manually sets the IDs of FieldOfScience (FOS) entries, this creates a mismatch
between the actual FOS IDs and the sequence that Postgres uses to auto-increment them
"""
super().setUp()
with connection.cursor() as cursor:
cursor.execute(
'SELECT setval(pg_get_serial_sequence(\'field_of_science_fieldofscience\',\'id\'), coalesce(max("id"), 1), max("id") IS NOT null) FROM "field_of_science_fieldofscience";'
)

def test_command_output(self):
old_fos_1 = self.new_field_of_science()
old_fos_2 = self.new_field_of_science()
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ python-keystoneclient
python-novaclient
python-neutronclient
python-swiftclient
psycopg2