Skip to content

Commit

Permalink
Merge pull request #381 from ral-facilities/feature/icat5-tests#374
Browse files Browse the repository at this point in the history
Changes to tests so they pass with icat 5
  • Loading branch information
Reillyhewitson authored Nov 3, 2022
2 parents 8eb3ea4 + 4d6b066 commit 9bb898d
Show file tree
Hide file tree
Showing 10 changed files with 184 additions and 128 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ but covering only the most used aspects of the API).
The configuration file (`config.json`) contains two options that will be used during the
testing of the API. Set `test_user_credentials` and `test_mechanism` appropriately for
your test environment, using `config.json.example` as a reference. The tests require a
connection to an instance of ICAT, so set the rest of the config as needed.
connection to an instance of ICAT 5, so set the rest of the config as needed. These tests have been written to assume ICAT 5 has been installed so please update to that or test with an older version of the API.

By default, this will execute the repo's tests in
Python 3.6, 3.7, 3.8, 3.9 and 3.10. For most cases, running the tests in a single Python
Expand Down
2 changes: 2 additions & 0 deletions datagateway_api/src/datagateway_api/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@ class INVESTIGATION(Base, EntityHelper, metaclass=EntityMeta):
typeID = Column(
"TYPE_ID", ForeignKey("INVESTIGATIONTYPE.ID"), nullable=False, index=True,
)
fileSize = Column("FILESIZE", BigInteger)
fileCount = Column("FILECOUNT", BigInteger)

FACILITY = relationship(
"FACILITY",
Expand Down
11 changes: 10 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,16 @@ def safety(session):
f"--output={requirements.name}",
external=True,
)
session.run("safety", "check", f"--file={requirements.name}", "--full-report")
# Ignore 50916 as the latest version of pydantic does not support
# python 3.6 which is still used in production
session.run(
"safety",
"check",
f"--file={requirements.name}",
"--full-report",
"--ignore",
"50916",
)

try:
# Due to delete=False, the file must be deleted manually
Expand Down
Loading

0 comments on commit 9bb898d

Please sign in to comment.