js-algorand-sdk icon indicating copy to clipboard operation
js-algorand-sdk copied to clipboard

New Feature: Implemented disassemble method

Open kael-shipman opened this issue 2 years ago • 2 comments

This implementation closes #621

kael-shipman avatar Aug 10 '22 19:08 kael-shipman

I couldn't figure out how to write tests for this, so I would appreciate a push in the right direction. I searched the tests directory for compile to try to just copy those tests, and I found some in the cucumber directory, but I couldn't make sense of them. Any help is appreciated.

kael-shipman avatar Aug 10 '22 19:08 kael-shipman

nice! thanks for submitting this.

Tests are written for all the sdks in this repo https://github.com/algorand/algorand-sdk-testing/

Once written you can tweak the git clone line in https://github.com/algorand/js-algorand-sdk/blob/develop/tests/cucumber/docker/run_docker.sh to point to your copy and run it to pull the tests down

Then enable the tagged tests in the Makefile by adding or @your.test or commenting the rest of them out and adding yours alone for faster iteration.

@michaeldiamant anything to add?

barnjamin avatar Aug 10 '22 19:08 barnjamin

@kael-shipman Thanks for offering a contribution!

Let us know if the above note + this note help provide a stating point.

@michaeldiamant anything to add?

Linking to a recent test addition example + corresponding implementation in js-algorand-sdk:

  • https://github.com/algorand/algorand-sdk-testing/pull/199
  • https://github.com/algorand/js-algorand-sdk/pull/590

The example illustrates a couple of facets:

  • Adding a custom tag (@compile.sourcemap) to support adding functionality in each SDK incrementally.
  • Unit + integration style test examples to illustrate typical test setup and scope.

michaeldiamant avatar Aug 15 '22 14:08 michaeldiamant

Ah, thanks! I saw this comment but marked it "read" and forgot to come back to it. I'll see if I have time today to add some tests. Thanks for the push!

kael-shipman avatar Aug 15 '22 15:08 kael-shipman

nice! thanks for submitting this.

Tests are written for all the sdks in this repo https://github.com/algorand/algorand-sdk-testing/

Once written you can tweak the git clone line in https://github.com/algorand/js-algorand-sdk/blob/develop/tests/cucumber/docker/run_docker.sh to point to your copy and run it to pull the tests down

Then enable the tagged tests in the Makefile by adding or @your.test or commenting the rest of them out and adding yours alone for faster iteration.

@michaeldiamant anything to add?

Update: we have recently refactored the way tests work. The general approach described by @barnjamin remains the same. But there is no longer a run_docker.sh script where you would tweak the git clone branch of sdk-testing. Instead, this is managed in .test-env. You would also need merge the latest from develop into this pull request.

tzaffi avatar Sep 07 '22 13:09 tzaffi

Sorry, I've moved on to other things and don't know if I'll get a chance to figure out how testing works for this. I took a look at it last week and it wasn't immediately obvious to me how to write test cases, although the examples were helpful. Given that, you can feel free to close this PR if no one is available to fill in the tests.

kael-shipman avatar Sep 07 '22 14:09 kael-shipman

@kael-shipman Thanks for the update. I appreciate you took a look at the testing methodology and totally understand that it's a greater time investment than you have available now. Closing the PR for now.

michaeldiamant avatar Sep 08 '22 13:09 michaeldiamant