- Install Elixir
The recommended way to install elixir is using
asdf
. This allows you to manage multiple versions of elixir/erlang on your machine. To installasdf
, see their Getting Started docs. For macs you can install via homebrew:
brew install asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc
Then restart your shell.
Next, install erlang and elixir via asdf:
asdf plugin add erlang
asdf install erlang 25.3.2.2
asdf global erlang 25.3.2.2
asdf plugin add elixir
asdf install elixir 1.14.5
asdf global elixir 1.14.5
Alternately you may install elixir via homebrew, which is a little faster for the initial install but will prevent you from being able to easily switch between different versions of elixir/erlang. To install via homebrew:
* `brew install elixir`
- Clone repo
git clone [email protected]:momentohq/client-sdk-elixir.git
- Switch to the src directory
cd src
- Pull down the dependencies and compile
mix deps.get
mix compile
- To run unit tests:
mix test
- To run integration tests:
- Generate auth token with momento-cli (if you don't already have one)
TEST_AUTH_TOKEN=<auth token> TEST_CACHE_NAME=<cache id> mix test integration-test
TEST_CACHE_NAME
is required. Give it any string value for now.
Mix has a built-in formatting tool that should be run before any commit:
mix format
Use dialyzer to check types before committing:
mix dialyzer