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

Property Based Tests with IPFS #24

Closed
4 tasks done
Danwhy opened this issue Jan 29, 2019 · 9 comments
Closed
4 tasks done

Property Based Tests with IPFS #24

Danwhy opened this issue Jan 29, 2019 · 9 comments
Assignees

Comments

@Danwhy
Copy link
Member

Danwhy commented Jan 29, 2019

I think it would be a good idea to run some property based tests for this module, where we generate strings, maps and structs and run our Cid.cid function.

We can then compare the results of these function calls with the ipfs result of the same values.

This will provide us with a comprehensive list of tests, that change every time we run them, meaning we can be sure the module is creating the cid correctly every time.

  • install ipfs to travis
  • create property based tests
    • generate random strings/maps
    • compare result of cid function to ipfs function
@Danwhy Danwhy added the enhancement New feature or request label Jan 29, 2019
@Danwhy
Copy link
Member Author

Danwhy commented Jan 29, 2019

This will require us to download ipfs to travis to run our tests:

https://docs.ipfs.io/introduction/install/

@nelsonic
Copy link
Member

@Danwhy now you're onto something! 😍

@RobStallion
Copy link
Member

Going to try and install IPFS locally on @Danwhy 's machine with curl and the commands from IPFS. If we can do this on his machine then we should be able to recreate these steps with travis.

@nelsonic
Copy link
Member

@Danwhy / @RobStallion thank you for adding the T4 Label (_which seems reasonable if you document how to set-up IPFS CLI on Travis-CI and add some notes on Property-based-Testing to the README.md (or a separate doc) of https://github.com/dwyl/learn-elixir as per dwyl/learn-elixir#93

Please take a few minutes to follow dwyl/product-ux-research#34
(i.e. install and use the app to track the actual time you take on this issue...)

Thanks! (and keep up the great effort!) ✨

@RobStallion
Copy link
Member

RobStallion commented Jan 29, 2019

Travis failed to build with the updated yml file.

$ ./install.sh
We cannot install ./ipfs in one of the directories /usr/local/bin /usr/bin
It seems that we do not have the necessary write permissions.
Perhaps try running this script as a privileged user:
    sudo ./install.sh
The command "./install.sh" failed and exited with 1 during .
Your build has been stopped.

Going to try suggested fix.

RobStallion added a commit that referenced this issue Jan 29, 2019
RobStallion added a commit that referenced this issue Jan 29, 2019
@Danwhy
Copy link
Member Author

Danwhy commented Jan 29, 2019

screen shot 2019-01-29 at 14 51 23

Installed correctly, just need to make sure we cd back out of the ipfs directory

@RobStallion
Copy link
Member

Successfully installed IPFS on travis...
image

@RobStallion
Copy link
Member

forgetting basic steps...

image

Going to add ipfs init to travis yml

@Danwhy
Copy link
Member Author

Danwhy commented Jan 31, 2019

Tests added and running on Travis 👍

@Danwhy Danwhy closed this as completed Jan 31, 2019
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

3 participants