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: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
command: |
sudo apt-get --allow-releaseinfo-change-suite update && sudo apt-get install -y default-jdk
mkdir flyway
curl -sL https://github.com/flyway/flyway/releases/download/flyway-11.11.2/flyway-commandline-11.11.2-linux-x64.tar.gz | tar zxv -C flyway
echo 'export PATH=./flyway/flyway-11.11.2:$PATH' >> $BASH_ENV
curl -sL https://github.com/flyway/flyway/releases/download/flyway-11.13.1/flyway-commandline-11.13.1-linux-x64.tar.gz | tar zxv -C flyway
echo 'export PATH=./flyway/flyway-11.13.1:$PATH' >> $BASH_ENV

- restore_cache:
keys:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ We are always trying to improve our documentation. If you have suggestions or ru
- Read a [Windows tutorial](https://www.postgresqltutorial.com/install-postgresql/)
- Read a [Linux tutorial](https://www.postgresql.org/docs/13/installation.html) (or follow your OS package manager)
- Elastic Search 7.x (instructions [here](https://www.elastic.co/guide/en/elasticsearch/reference/7.X/install-elasticsearch.html))
- Flyway 11.11.2 ([homebrew instructions](https://formulae.brew.sh/formula/flyway))
- Flyway 11.13.1 ([homebrew instructions](https://formulae.brew.sh/formula/flyway))

- After downloading, create a .toml file in the following location: `flyway-11.11.2/conf/flyway.toml` and set the flyway environment variables `environment`, `url`, `user`, `password` and`locations` as
- After downloading, create a .toml file in the following location: `flyway-11.13.1/conf/flyway.toml` and set the flyway environment variables `environment`, `url`, `user`, `password` and`locations` as

```
[environments.local]
Expand Down
4 changes: 2 additions & 2 deletions data/flyway/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ repositories {
}

dependencies {
implementation group: "org.flywaydb", name: "flyway-gradle-plugin", version: "11.11.2"
implementation (group: "org.flywaydb", name: "flyway-commandline", version: "11.11.2") {
implementation group: "org.flywaydb", name: "flyway-gradle-plugin", version: "11.13.1"
implementation (group: "org.flywaydb", name: "flyway-commandline", version: "11.13.1") {
exclude group: "com.microsoft.sqlserver", module: "msql-jdbc"
exclude group: "com.h2database", module: "h2"
exclude group: "com.pivotal.jdbc", module: "greenplumdriver"
Expand Down
2 changes: 1 addition & 1 deletion data/flyway/manifest_headless_flyway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ applications:
command: /home/vcap/app/flyway/bin/run.sh && echo SUCCESS && sleep infinity
path: build/distributions/flyway.zip
env:
CLASSPATH: app/gradle/lib/flyway-commandline-11.11.2.jar:app/gradle/lib/flyway-core-11.11.2.jar
CLASSPATH: app/gradle/lib/flyway-commandline-11.13.1.jar:app/gradle/lib/flyway-core-11.13.1.jar
JAVA_HOME: /home/vcap/app/.java-buildpack/open_jdk_jre
services:
- fec-flyway-creds
14 changes: 8 additions & 6 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@
from webservices.rest import create_app, db
from webservices import __API_VERSION__


from webservices.legal.constants import (TEST_CASE_INDEX, TEST_ARCH_MUR_INDEX, TEST_AO_INDEX,
TEST_CASE_ALIAS, TEST_ARCH_MUR_ALIAS, TEST_AO_ALIAS)
TEST_CASE_ALIAS, TEST_ARCH_MUR_ALIAS, TEST_AO_ALIAS,
TEST_RM_INDEX, TEST_RM_ALIAS)

from webservices.legal.utils_es import create_test_indices, create_es_client
from tests.test_legal.test_legal_data import document_dictionary
from tests.test_legal.test_rm_data import rm_document_dictionary
from jdbc_utils import to_jdbc_url
from sqlalchemy import text

TEST_CONN = os.getenv('SQLA_TEST_CONN', 'postgresql:///cfdm_unit_test')
ALL_INDICES = [TEST_CASE_INDEX, TEST_AO_INDEX, TEST_ARCH_MUR_INDEX]
ALL_INDICES = [TEST_CASE_INDEX, TEST_AO_INDEX, TEST_ARCH_MUR_INDEX, TEST_RM_INDEX]


def _setup_extensions(db):
Expand Down Expand Up @@ -212,7 +213,7 @@ def _results_citations(self, qry):
def _results_rm(self, qry):
response_rm = self._response_rm(qry)
self.assertNotEqual(response_rm["total_rulemakings"], 0)
return response_rm["total_rulemakings"]
return response_rm["rulemakings"]


def _create_all_indices():
Expand All @@ -236,10 +237,11 @@ def _insert_all_documents(es_client):
insert_documents("advisory_opinions", TEST_AO_ALIAS, es_client)
insert_documents("ao_citations", TEST_AO_ALIAS, es_client)
insert_documents("mur_citations", TEST_CASE_ALIAS, es_client)
insert_documents("rulemakings", TEST_RM_ALIAS, es_client, rm_document_dictionary)


def insert_documents(doc_type, index, es_client):
for doc in document_dictionary[doc_type]:
def insert_documents(doc_type, index, es_client, doc_dict=document_dictionary):
for doc in doc_dict[doc_type]:
es_client.index(index=index, body=doc)

wait_for_refresh(es_client, index)
Expand Down
1 change: 0 additions & 1 deletion tests/test_legal/test_case_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def test_all_doc_types(self):
all_legal_docs = document_dictionary.copy()
all_legal_docs.pop("ao_citations")
all_legal_docs.pop("mur_citations")
all_legal_docs.pop("rulemakings")

total_all = 0
total_all += sum(len(all_legal_docs[doc_type]) for doc_type in all_legal_docs)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_legal/test_case_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from webservices.common.models import db
from webservices.legal.legal_docs.current_cases import get_cases, load_mur_citations

from webservices.legal.constants import TEST_CASE_INDEX
from tests.common import TEST_CONN, BaseTestCase


Expand Down Expand Up @@ -346,6 +346,7 @@ def test_mur_with_participants_and_documents(self, get_bucket, get_credential):

@patch('webservices.env.env.get_credential', return_value='BUCKET_NAME')
@patch('webservices.legal.legal_docs.current_cases.get_bucket')
@patch('webservices.legal.legal_docs.current_cases.CASE_ALIAS', TEST_CASE_INDEX)
def test_mur_with_disposition(self, get_bucket, get_credential):
case_id = 1
case_no = '1'
Expand Down
Loading