.circleci | ||
codegen | ||
db-tests | ||
docs | ||
migrations | ||
scripts | ||
src | ||
tools/spanner | ||
.clog.toml | ||
.gitignore | ||
.travis.yml | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
docker-compose.e2e.yaml | ||
docker-compose.yaml | ||
Dockerfile | ||
LICENSE | ||
make_hawk_token.py | ||
PULL_REQUEST_TEMPLATE.md | ||
README.md | ||
spanner-2019-10-01.ddl | ||
version.json |
Syncstorage-rs
Mozilla Sync Storage node built with Rust.
API docs: https://mozilla-services.readthedocs.io/en/latest/storage/apis-1.5.html
Code docs: https://mozilla-services.github.io/syncstorage-rs/syncstorage/
Functional tests live in https://github.com/mozilla-services/server-syncstorage/ and can be run against a local server, e.g.:
Requirements
- Rust stable
- MySQL 5.7 (or compatible)
- libmysqlclient (
brew install mysql
on macOS,apt-get install libmysqlclient-dev
on Ubuntu)
- libmysqlclient (
Setting Up
-
Install Rust and Install Go.
-
Create a
syncstorage
user/database. In the mysql shell:CREATE USER "syncstorage"@"localhost" IDENTIFIED BY "password"; CREATE DATABASE syncstorage;`
-
Run:
$ export SYNC_MASTER_SECRET=<SOMESECRET> $ export SYNC_DATABASE_URL=mysql://<YOUR_MYSQL_USERNAME>:<YOUR_MYSQL_PASSWORD>@localhost/syncstorage $ cargo run
Logging
If you want to connect to the existing Sentry project for local development, login to Sentry, and go to the page with api keys. Copy the DSN
value, and export SENTRY_DSN=DSN_VALUE_GOES_HERE
to the environment when running this project.
Running the Unit tests
-
Run:
$ export RUST_TEST_THREADS=1 $ cargo test
Running the End-to-End tests
-
If you haven't already followed the instructions here to get all the dependencies for the server-syncstorage repo, you should start there.
-
Install (Python) server-syncstorage:
$ git clone https://github.com/mozilla-services/server-syncstorage/ $ cd server-syncstorage $ make build
-
Run an instance of syncstorage-rs (see step 3 above).
-
Run:
$ ./local/bin/python syncstorage/tests/functional/test_storage.py http://localhost:8000#<SOMESECRET>
Individual tests can be specified via the SYNC_TEST_PREFIX
env var:
$ SYNC_TEST_PREFIX=test_get_collection \
./local/bin/python syncstorage/tests/functional/test_storage.py http://localhost:8000#<SOMESECRET>