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

database: add filter to insert logic #623

Merged
merged 2 commits into from
Feb 19, 2018

Conversation

hppritcha
Copy link
Member

Turns out clients can be generating more
fields/values than the database/cherrypy server
know about owing to separate MTT based projects
contributing code.

Fixes #614

Signed-off-by: Howard Pritchard howardp@lanl.gov

Turns out clients can be generating more
fields/values than the database/cherrypy server
know about owing to separate MTT based projects
contributing code.

Fixes open-mpi#614

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@hppritcha
Copy link
Member Author

Howard's a happy camper with this patch:

           "test_result": 0
        }
    ],
    "metadata": {
        "client_serial": 2161941,
        "hostname": "invierno",
        "http_username": "lanl",
        "local_username": "hpp",
        "mtt_client_version": "4.0a1",
        "phase": "Test Run",
        "platform_name": "NMC-invierno",
        "trial": 1
    }
}
<<<<<<<---------------- Payload (End  ) -------------------------->>>>>>
<<<<<<<---------------- Response -------------------------->>>>>>
Result: 200: application/json
{'Content-Length': '100', 'Content-Type': 'application/json', 'Set-Cookie': 'session_id=03daaf97e1aa595a59c1bd17f0a01adbd21e5755; expires=Fri, 16 Feb 2018 23:17:12 GMT; Path=/', 'Date': 'Fri, 16 Feb 2018 22:17:12 GMT', 'Allow': 'GET, HEAD, POST', 'Keep-Alive': 'timeout=5, max=68', 'Access-Control-Allow-Origin': '*', 'Server': 'CherryPy/8.9.0', 'Connection': 'Keep-Alive'}
OK
<<<<<<<---------------- Raw Output (Start) ---------------->>>>>>
{"status": 0, "submit_id": 574966, "status_message": "Success", "ids": [{"test_run_id": 432902670}]}
<<<<<<<---------------- Raw Output (End  ) ---------------->>>>>>
b'2018-02-16 15:17:12.925922 Done executing [Reporter: IU database] plugin=IUDatabase elapsed=0:00:05.485625'
b'LOGGING results for Reporter: IU database'

@ribab ribab self-requested a review February 16, 2018 22:48
Copy link
Contributor

@ribab ribab left a comment

Choose a reason for hiding this comment

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

Looks good! And you tested it

I say merge :)

Copy link
Member

@jjhursey jjhursey left a comment

Choose a reason for hiding this comment

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

I think the only thing I would add to this is if we reject a field because it is not in the table, then we should probably issue a warning - in the log and/or back to the user. But that's not a show stopper.
Thanks!

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@hppritcha
Copy link
Member Author

@jjhursey good idea. I added the debug output back in. Here's what the AWS mtt database doesn't know about:

2018-02-18 22:51:46,200] DEBUG WARNING: _select_insert field clck_id not in table test_run
[2018-02-18 22:51:46,200] DEBUG WARNING: _select_insert field bios_id not in table test_run
[2018-02-18 22:51:46,200] DEBUG WARNING: _select_insert field firmware_id not in table test_run
[2018-02-18 22:51:46,200] DEBUG WARNING: _select_insert field provision_id not in table test_run
[2018-02-18 22:51:46,200] DEBUG WARNING: _select_insert field harasser_id not in table test_run

@hppritcha hppritcha merged commit cf2aa4b into open-mpi:master Feb 19, 2018
emallove pushed a commit to emallove/mtt that referenced this pull request Dec 7, 2019
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.

4 participants