-
Notifications
You must be signed in to change notification settings - Fork 318
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
Update readingsCompareMeterQuantity.js #1413
base: development
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks to @alecdog04, @miaescobar1 & @Aung-Khant-Min1211 for their first contribution to OED. I have made several comments that should be addressed. It may help to try local testing of this file on your machine as described in the design doc for testing (step 9). Please let me know if you need anything.
@@ -85,7 +85,19 @@ mocha.describe('readings API', () => { | |||
expectCompareToEqualExpected(res, expected); | |||
}); | |||
|
|||
// Add C6 here | |||
mocha.it('C6: 28 day shift end 2022-10-31 17:00:00 for 15 minute reading intervals and quantity units & kWh as kWh', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text in the design doc is slightly different with "28 day shift end 2022-10-31 17:12:34 (partial hour) for 15 minute reading intervals and quantity units & kWh as kWh". Could this be updated to match?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thank you for your prompt feedback!
.query({ | ||
curr_start: '2022-10-09 00:00:00', | ||
curr_end: '2022-10-31 17:00:00', | ||
shift: 'P28D', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specified time was '2022-10-31 17:12:34'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thank you for your prompt feedback!
const unitId = await getUnitId('kWh'); | ||
const expected = [108269.924822581, 108889.847659507]; | ||
const res = await chai.request(app).get('/api/compareReadings/meters/${METER_ID}') | ||
.query({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quotes need to be backquotes so the METER_ID is treated as a variable, e.g., `/api/compareReadings/meters/${METER_ID}`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, thank you for your prompt feedback!
curr_end: '2022-10-31 17:00:00', | ||
shift: 'P28D', | ||
graphicUnitID:unitId | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "d" in graphicUnitID must be lowercase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! We'll get to work making those changes and testing on our local machine.
|
My bad I misclicked on closing the pull request |
@huss I'm following step 9 to test our code locally but I'm getting this error relating to a database |
@alecdog04 I cannot be sure but let me ask the following:
Let me know if any of this helps and once I know more information I'll try to help more (if needed). |
Hi @huss, just letting you I added another commit with the changes that you requested. I'll double-check with Alec about your comments about the error message and will get back to you as soon as possible. Thank you again! |
|
… errors, indicated that OED docker database container must be running
I forgot to mention this in my previous comments so I added a final output statement to tell where the backup was placed.
c499d39
to
c359fbd
Compare
@alecdog04 This seems to be a blocking of the Postgres port (5432). The terminal seems to be a regular on and not one opened on the OED web Docker container. I'm wondering if that is the issue. |
Hi @huss, I tested the readingsCompareMeterQuantity.js file in a codespace of Alec's forked repository. It seems to work as expected. |
@miaescobar1 Great. If you want me to look at something else then let me know. Otherwise I'll consider this resolved and plan to review this PR in the near future. If you could provide how you ran OED and the tests in Codespaces that would be great. I'd like to try it and post directions for other developers. Thanks. |
@huss Great, thanks so much again! Running the tests in codespaces(It’s already explained well here, under "Rapid testing of a one or a few test(s)")
Note: There was no need to run OED locally to run the tests. You can do this all directly in Git codespaces. Running OED locally using MacOs terminal
|
Description
Authors: Alec Gonzales(alecdog04), Mia Escobar(miaescobar1), AungKhant Min (Aung-Khant-Min1211)
Wrote test case C6, verifying the compare readings API for an electric meter. The shift period is 28 days, ensuring the API can handle long-period shifts. This test also validates timestamp alignment for 15-minute reading intervals and proper unit conversion from Electric_Utility to kWh. This test case was completed as part of the CTI open source internship cohert.
Partly Addresses #issue #962, Test Case C6
Type of change
(Check the ones that apply by placing an "x" instead of the space in the [ ] so it becomes [x])
Checklist
(Note what you have done by placing an "x" instead of the space in the [ ] so it becomes [x]. It is hoped you do all of them.)