dwyl / cid

❄️cid ("content id") is a human-friendly (readable/typeable) unique ID function built for distributed/decentralised systems.
GNU General Public License v2.0
34 stars 3 forks source link

Property Based Tests with IPFS #24

Closed Danwhy closed 5 years ago

Danwhy commented 5 years ago

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.

Danwhy commented 5 years ago

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

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

nelsonic commented 5 years ago

@Danwhy now you're onto something! 😍

RobStallion commented 5 years ago

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 commented 5 years ago

@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 https://github.com/dwyl/learn-elixir/issues/93

Please take a few minutes to follow https://github.com/dwyl/product-ux-research/issues/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 commented 5 years ago

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.

Danwhy commented 5 years ago
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 commented 5 years ago

Successfully installed IPFS on travis... image

RobStallion commented 5 years ago

forgetting basic steps...

image

Going to add ipfs init to travis yml

Danwhy commented 5 years ago

Tests added and running on Travis :+1: