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

Added test BG14 #1352

Open
wants to merge 1 commit into
base: development
Choose a base branch
from

Conversation

Emily-D-2003
Copy link

@Emily-D-2003 Emily-D-2003 commented Oct 3, 2024

Description

Added tests BG14 from design document.

Partly addresses #962

Type of change

  • Note merging this changes the database configuration.
  • This change requires a documentation update

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.)

  • I have followed the OED pull request ideas
  • I have removed text in ( ) from the issue request
  • You acknowledge that every person contributing to this work has signed the OED Contributing License Agreement and each author is listed in the Description section.

@Emily-D-2003 Emily-D-2003 mentioned this pull request Oct 3, 2024
Copy link
Member

@huss huss left a comment

Choose a reason for hiding this comment

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

Thanks to @Emily-D-2003 for their first pull request. First, my records do not indicate you signed the CLA. OED cannot accept your contribution without that. Second, I have made several comments to consider. I believe this is why the GitHub test failed for the new test case (it also failed locally on my machine).

//gets unit ID
const unitId = await getUnitId('pound of CO₂');
//load data from mcsv file
const expected = await parseExpectedCsv('src/server/test/web/readingsData/expected_bar_group_ri_15-20_mu_kWh_gu_lbsCO2_st_-inf_et_inf_bd_1.csv');
Copy link
Member

Choose a reason for hiding this comment

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

The expected file needs to be downloaded from the Dev Docs and added in the appropriate place in the repository. Direction are here: https://github.com/OpenEnergyDashboard/DesignDocs/blob/main/testing/testing.md#documentation-on-how-testing-data-is-created-and-used.

@@ -207,8 +207,22 @@ mocha.describe('readings API', () => {

// Add BG13 here

// Add BG14 here
mocha.it('BG14: 1 day bars for 15 + 20 minute reading intervals and quantity units with +-inf start/end time & kWh as lbs of CO2 & chained & reversed', async () =>{
//loads data into database
Copy link
Member

Choose a reason for hiding this comment

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

The description lists these units/conversions: u2, u10, u11, u12, u13, c11, c12, c13, c14. All but u2 need to be included in the test. Test B14 uses the same units and is completed.

await prepareTest(unitDatakWh, conversionDatakWh, meterDatakWhGroups, groupDatakWh);
//gets unit ID
const unitId = await getUnitId('pound of CO₂');
//load data from mcsv file
Copy link
Member

Choose a reason for hiding this comment

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

mcsv -> csv.

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