ocean.js icon indicating copy to clipboard operation
ocean.js copied to clipboard

Issue-#1195: "C2D Flow" README works in v4

Open miquelcabot opened this issue 2 years ago • 9 comments

Fixes #1195

Changes proposed in this PR:

  • Add C2DExamples.test.ts test script
  • Generate automatically C2DExamples.mdmarkdown file

miquelcabot avatar Jun 28 '22 16:06 miquelcabot

@miquelcabot I have updated the workflow so:

  • user touches marketplace.json
  • sed matches and replace the import config path.

idiom-bytes avatar Jul 19 '22 05:07 idiom-bytes

Hi @miquelcabot and @jamiehewitt15 I tagged both of you as I saw your names in the github annotations. I'm reviewing the script for createCodeExamples.sh and I'm continuing to run into issues:

  • Tutorial suggest user to create a .js file but all the inner workings are in .ts
  • shell script is using sed to remove chai test functions such as before() and it(), but it fails to properly substitute for an async function
  • There is nothing in the documentation that tells what the user needs to compile from .ts => .js, and run it. If the user tries to use node marketplace.js he will receive ES6 import-related errors.

I understand the overall drive to want to go from an internal .ts test => clean documentation, but this seems like more effort than it's worth and perhaps fragile too. I.E. Why not just have the documentation.md updated?

Cheers!

idiom-bytes avatar Jul 19 '22 06:07 idiom-bytes

Here is another issue.

The following import is local to ocean.js / test folder.

import { getAddresses, getTestConfig, web3 } from '../config'

Meaning that the config helper functions above are not bundled/exported with the @oceanprotocol/lib module.

Downstream, when the user is going through the marketplace or C2D flow, he will try to import this from @oceanprotocol/lib, and will be unable to.

idiom-bytes avatar Jul 19 '22 06:07 idiom-bytes

Code Climate has analyzed commit 0db80125 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 73.2%.

View more on Code Climate.

codeclimate[bot] avatar Jul 20 '22 17:07 codeclimate[bot]

@miquelcabot do you have an idea of why the tests are failing?

jamiehewitt15 avatar Jul 25 '22 09:07 jamiehewitt15

@jamiehewitt15 No. I'm reviewing it. But the error comes from a file that I haven't modified :(

miquelcabot avatar Jul 25 '22 09:07 miquelcabot

@jamiehewitt15 I have seen that these tests are also failing in the main branch. Any ideas about what can be failing? @mihaisc @bogdanfazakas The test that is failing is ComputeFlow.test.ts.

miquelcabot avatar Jul 25 '22 13:07 miquelcabot

@jamiehewitt15 I have seen that these tests are also failing in the main branch. Any ideas about what can be failing? @mihaisc @bogdanfazakas The test that is failing is ComputeFlow.test.ts.

Ah ok, I guess it's an issue with compute to data then that should be handled in a separate PR

jamiehewitt15 avatar Jul 25 '22 14:07 jamiehewitt15

By now tending towards @idiom-bytes's suggestion of simply writing stuff in the markdown files and be done with it.

If that's the direction we go in then we could just abandon this altogether and then make sure we're covering everything properly in the docs. The readme here can be updated with links to the relevant tutorials, similar to how we have done it in the market

jamiehewitt15 avatar Aug 25 '22 09:08 jamiehewitt15

Closing this since it is handled in #1615

bogdanfazakas avatar Sep 27 '22 07:09 bogdanfazakas