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

graph-validation-tests integration #10

Conversation

RichardBruskiewich
Copy link
Contributor

@RichardBruskiewich RichardBruskiewich commented Apr 23, 2024

@maximusunc (@sierra-moxon) here's the latest 'graph-validation-test' mocked up code PR against the TestHarness. I actually have merged against your latest main branch code (release v0.1.9) but haven't take a close look.

It has some relative links across the stack. It mostly uses Pydantic V2 except in reasoner-pydantic (as discussed).

At the moment, despite earnest efforts, I can't seem to single step in PyCharms 'debug' mode to figure out why the test fails in "run" mode...

The graph-validation-tests code seems to work in unit tests in its own repository. There is something else going on here which I do not yet understand...

Tomorrow is another day.

…_run.py including a one hop test testrunner (with mock data); probably not yet fully properly coded
# benchmarks-runner==0.1.3
# ui-test-runner==0.0.2
# graph-validation-tests==0.0.10
-e 'git+https://github.com/TranslatorSRI/graph-validation-tests.git@main#egg=graph-validation-tests'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to stick with packages directly from pypi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, sorry.. that was just a transient situation. I totally agree...

Originally, a fresh graph-validation-tests release was awaiting fresh release of the model (or other package?). I'll review the situation right now and adjust the dependency accordingly.

README.md Outdated
- `pip install -r requirements.txt` to install normal dependencies
- `pip install -r requirements-runners.txt` to install the Test Runners
- `pip install -r requirements-runners.txt` (or **requirements-runners-win64.txt** using Python 3.12 for _jq_ module compatibility) to install the Test Runners
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily a Windows h8ter, but could we potentially just have a section in the README for instructions on Windows instead of putting binaries and different requirements in the repo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually a huge Windoze fan myself, just that a Dell workstation running it felt like a good choice the time I needed a new home workstation (I did look at Apple Mac as an alternative but...much higher cost/benefit ratio).

Again, the workarounds here are a bandage .. For sure, we can add a separate README patch recipe section about Windoze.

I spend a couple of hours one day trying to find a Windoze solution to the *nix jq dependency. Found a partial answer which is still problematic.

I think you mentioned that perhaps, the jq wasn't a strict necessity wherever it is used; otherwise, we will need to somehow build acceptable Windoze jq wheels (cached in the project) as a workaround.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to bring it up because it seemed you had put some significant work into getting jq to work, but yes, it is currently not being used (it is used in the UI Test Runner that I made, but we are currently not/can't test the UI at this time).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @maximusunc, I simply attempted to troubleshoot the issue, only partly successfully. If we remove jq from the dependencies (for now), the problem goes away, right?

setup.py Outdated
@@ -7,7 +7,7 @@

setup(
name="sri-test-harness",
version="0.1.4",
version="0.1.9",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bump the minor version

@@ -8,9 +8,11 @@ class Slacker:
def __init__(self, url=None):
self.url = url if url else os.getenv("SLACK_WEBHOOK_URL")

async def post_notification(self, messages=[]):
async def post_notification(self, messages=None):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for my understanding, what's the advantage of doing it this way? I guess if messages is passed in as None?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PyCharms complained that the "Default argument value is mutable". I guess replacing it with a Tuple removes this complain?

@maximusunc
Copy link
Collaborator

One other knit-picky comment is that we've tried to include the name runner in all of the test runner packages so far.


from .reporter import Reporter
from .slacker import Slacker


def get_tag(result):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're now firmly in the realm of creating a utils file with all these small helper functions.

@RichardBruskiewich
Copy link
Contributor Author

One other knit-picky comment is that we've tried to include the name runner in all of the test runner packages so far.

Sure, I can rename the two graph-validation-tests TestRunner implementations as such.

@@ -93,6 +133,20 @@ def cli():
help="Path to a file of tests to be run. This would be the same output from downloading the tests via `download_tests()`",
)

parser.add_argument(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should have a default value and be required. Either that or include what was passed in the error message inside the graph validation.

@maximusunc
Copy link
Collaborator

I got the thing to run (just a few hacks) and the output is an empty dict.

@RichardBruskiewich
Copy link
Contributor Author

RichardBruskiewich commented May 7, 2024

@maximusunc I've responded to all of your feedback above. Please see the latest set of commits, hence, latest file content. I've not attempted to reconcile the latest code with the master branch.

Let me know where things sit now.

I'll revisit the test runners tomorrow to see if I can directly get more sensible test output out of them, from some components.

@RichardBruskiewich RichardBruskiewich dismissed maximusunc’s stale review May 10, 2024 20:58

Out of date: previously requested changes have now been made.

Copy link
Collaborator

@maximusunc maximusunc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to make a list of comments:

  • If given an unsupported target (i.e. ARS), the validation runner gives a useful message but then doesn't return any results and therefore the Test Harness code errors out.
  • Do warnings cause the test to fail, or just errors? Could we get the errors to show up first in the log message dict? Right now they show up after the warnings
  • The one hop test runner seems off? I'm sending the same test case to arax and molepro and the former says the subject node is missing and the latter says the object node is missing.
  • I think it would be nice to have the trapi and biolink versions have defaults in the CLI
  • I mentioned this before, but could we move all the helper functions at the top of run.py into their own utils.py folder and get imported? run.py is just getting a little too big.

@RichardBruskiewich
Copy link
Contributor Author

RichardBruskiewich commented May 15, 2024

Hi @maximusunc, I'll iterate on your comments (copied here as a checklist for completion), refactoring accordingly, then post my progress here below, step-by-step, as it is achieved.

  • If given an unsupported target (i.e. ARS), the validation runner gives a useful message but then doesn't return any results and therefore the Test Harness code errors out. Resolved in graph-validation-test-runners commit b5c2735d6b
  • Do warnings cause the test to fail, or just errors? Could we get the errors to show up first in the log message dict? Right now they show up after the warnings; Resolved in graph-validation-test-runners commit 2fc53d8e1fe
  • The one hop test runner seems off? I'm sending the same test case to arax and molepro and the former says the subject node is missing and the latter says the object node is missing.
  • I think it would be nice to have the TRAPI and Biolink Model versions have defaults in the CLI Resolved in graph-validation-test-runners commit ac4ec00e32c
  • I mentioned this before, but could we move all the helper functions at the top of run.py into their own utils.py folder and get imported? run.py is just getting a little too big. I think that the graph validation test runner utility functions are already moved into util.py. I also just now extracted the initial fat comment block for the graph validation test runner, into a supplemental README

@RichardBruskiewich
Copy link
Contributor Author

Hi @maximusunc , as mentioned on Slack, I've covered most of your bullet points above with an update of the graph-validation-test-runners package to 0.1.3. I will review your last observation about ARAX and MolePro tomorrow, or soon thereafter. Meanwhile, you can verify whether most of your other concerns are now satisfied.

@maximusunc
Copy link
Collaborator

Closing in favor of #28

@maximusunc maximusunc closed this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants