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

get utility emissions channel automated tests working #80

Closed
sichen1234 opened this issue Feb 16, 2021 · 13 comments
Closed

get utility emissions channel automated tests working #80

sichen1234 opened this issue Feb 16, 2021 · 13 comments

Comments

@sichen1234
Copy link
Contributor

The automated tests in utility-emissions-channel/typescript_app/runTests.sh is not working. Get the tests to work and be able to verify the record emissions and get emissions.

@sichen1234
Copy link
Contributor Author

Currently the tests are described in https://github.com/hyperledger-labs/blockchain-carbon-accounting/tree/main/utility-emissions-channel#automated-tests. We need to get them working again.

@unnati914
Copy link

I am Unnati, a prefinal year student from India. I am applying for LFX Fall Mentorship Program this time. I saw the project and found the project interesting. The project really aligns my tech stack. So how should I proceed with this? Like should I make a proposal or is there any task to be done before the deadline?

Please let me know the further steps so that I could submit the application before the deadline

@udosson
Copy link
Member

udosson commented Aug 4, 2021

@unnati914, thanks for your comment. Let's take about the application process for the mentorship program via email. I've already answered your email.
If you already want to contribute to our lab prior to the official start of the mentorship programs we'd really appreciate this.
Just let us know if there is any issue you want to start working on. Then, we'll assign it to you.

@unnati914
Copy link

sure I am just understanding the code.. then I will take one good first issue

@unnati914
Copy link

I am getting errors while installing docker on windows.. could you please help me

@udosson
Copy link
Member

udosson commented Aug 4, 2021

Yes, I can support you. Please, use https://chat.hyperledger.org/channel/climate-action-sig for general communication that is not directly related to the issues. I'll give some advice in the Hyperledger rocket cat

@skant7
Copy link

skant7 commented Aug 14, 2021

hi @udosson I ran the tests on my local machine it seems that 3 tests pass and remaining 3 of them fail can you please check if its the same error or am I missing out on anything?
Here's a screenshot of the tests:-
Screenshot from 2021-08-15 02-16-02

@hs2361
Copy link
Contributor

hs2361 commented Sep 16, 2021

Hi, @sichen1234. In commit 739178f by @Zzocker , end-to-end testing was added which seems to account for all the cases that are covered by the automated tests in the test.js file. The tests can be run by running npm run test, and it appears that all 7 tests are passing. In that case, do we still need to retain the old tests, since the E2E tests cover the same tests? Please let me know so that I can proceed with the issue accordingly.

@Zzocker
Copy link
Member

Zzocker commented Sep 17, 2021

e2e test covers all the test cases of test.js along with 3 to 4 more test which checks some more corner cases. Also for running e2e test you won't have to put data by running the scripts form docker-setup folder. By running e2e test one mock emission record is inserted into the fabric.

@hs2361
Copy link
Contributor

hs2361 commented Sep 17, 2021

@Zzocker Do you think we can remove the test.js file entirely since the E2E tests are a superset of those tests? Please also take a look at the test case required by #190. If even that case is covered, @sichen1234 I think we can simply remove the file and close this issue, as well as #190.

@Zzocker
Copy link
Member

Zzocker commented Sep 17, 2021

Yes, it covers #190
here :

assert.equal(response.body.fromDate, '2020-05-07T10:10:09Z');
assert.equal(response.body.thruDate, '2021-05-07T10:10:09Z');

Also can you add a try/catch block here :

assert.isNull(error);
assert.equal(response.status, 201);
assert.equal(response.body.orgName, 'auditor1');
assert.equal(response.body.msp, 'auditor1');
assert.equal(response.body.caName, 'auditor1.carbonAccounting.com');
await insertMockData(registry);
done();

This is required, cuz if registerAdmin should pass fails, then the whole test will be stuck there.

@hs2361
Copy link
Contributor

hs2361 commented Sep 18, 2021

@sichen1234 Do you suggest that we close this issue, and then open a fresh issue for the changes suggested by @Zzocker?

@udosson
Copy link
Member

udosson commented Sep 20, 2021

@hs2361, yes you can close this issue and create a new issue with the changes suggested by @Zzocker. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants