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

Testing database #75

Open
mat-1 opened this issue Jan 8, 2021 · 5 comments
Open

Testing database #75

mat-1 opened this issue Jan 8, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@mat-1
Copy link
Member

mat-1 commented Jan 8, 2021

There should be a "mock database" object (maybe saves/loads from a json file?) for running the unit tests or testing locally if you don't want to set up a MongoDB database

@mat-1 mat-1 added the enhancement New feature or request label Jan 8, 2021
@frissyn
Copy link
Contributor

frissyn commented Jan 11, 2021

@mat-1 Looking through some of MongoDB's docs I found mongoexport, which could be used to clone the DB to a JSON file or otherwise.

You could also deploy a public Replica Set of the DB for others to connect to for testing locally.

These are just some ideas I wanted to toss up, check em out if you like =P

@PotentialStyx
Copy link
Member

@mat-1 Looking through some of MongoDB's docs I found mongoexport, which could be used to clone the DB to a JSON file or otherwise.

You could also deploy a public Replica Set of the DB for others to connect to for testing locally.

These are just some ideas I wanted to toss up, check em out if you like =P

The thing is we would need to remove a lot of stuff from the export/replica set, like session ids and stuff, and some of it might be needed in testing. So I think we are better off creating a json file that has the same layout/schema as the normal db but with filler content (like 3 entries, with different properties, a few fake users, and a few fake links)

@frissyn
Copy link
Contributor

frissyn commented Jan 12, 2021

@mat-1 Looking through some of MongoDB's docs I found mongoexport, which could be used to clone the DB to a JSON file or otherwise.
You could also deploy a public Replica Set of the DB for others to connect to for testing locally.
These are just some ideas I wanted to toss up, check em out if you like =P

The thing is we would need to remove a lot of stuff from the export/replica set, like session ids and stuff, and some of it might be needed in testing. So I think we are better off creating a JSON file that has the same layout/schema as the normal DB but with filler content (like 3 entries, with different properties, a few fake users, and a few fake links)

I thought the objective was to create a copy of the MongoDB for users who didn't want to make their own in order to test. Making a dummy DB doesn't like it would fit that goal. Anyways, the mongo driver has to connect to a server, so even after you figure out a way to dump the DB contents to a JSON file, you still need a way to serve it locally. I don't know how to do that, but @leon332157 said he'd work on it when he gets the chance.

@PotentialStyx
Copy link
Member

@mat-1 Looking through some of MongoDB's docs I found mongoexport, which could be used to clone the DB to a JSON file or otherwise.
You could also deploy a public Replica Set of the DB for others to connect to for testing locally.
These are just some ideas I wanted to toss up, check em out if you like =P

The thing is we would need to remove a lot of stuff from the export/replica set, like session ids and stuff, and some of it might be needed in testing. So I think we are better off creating a JSON file that has the same layout/schema as the normal DB but with filler content (like 3 entries, with different properties, a few fake users, and a few fake links)

I thought the objective was to create a copy of the MongoDB for users who didn't want to make their own in order to test. Making a dummy DB doesn't like it would fit that goal. Anyways, the mongo driver has to connect to a server, so even after you figure out a way to dump the DB contents to a JSON file, you still need a way to serve it locally. I don't know how to do that, but @leon332157 said he'd work on it when he gets the chance.

Ok, so we should host a mongo db set that is publicly writeable? If so we would still use filler values.

@selectdev
Copy link
Contributor

Maybe we could implent this somehow in v3, or create a real database and just supply the url in CONTRIBUTING.md and just allow anyone to use it although it could bring some security risks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants