Skip to content

Commit

Permalink
Disable auth for now (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi authored Aug 5, 2024
1 parent f622b24 commit 8449d70
Show file tree
Hide file tree
Showing 16 changed files with 266 additions and 252 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dance-trust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
fail-fast: false
matrix:
db:
- postgresql
- sqlite
- ferretdb-postgresql
- ferretdb-sqlite
- mongodb
test:
- enmeshed-runtime
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/dance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,29 @@ jobs:
fail-fast: false
matrix:
db:
- postgresql
- sqlite
- ferretdb-postgresql
- ferretdb-sqlite
- mongodb
test:
- dotnet
- dotnet-plain
- dotnet-scram
# - dotnet-plain
# - dotnet-scram

# - java
- java
# - java-plain
# - java-scram

- python
- python-plain
- python-scram
# - python-plain
# - python-scram

# - mongo-tools
- mongo-tools

# - restheart
- restheart
# - restheart-auth

# - ycsb-workloada
# - ycsb-workloadc
- ycsb-workloada
- ycsb-workloadc

steps:
- name: Checkout code
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ to include required submodules.
## Running tests

```sh
bin/task dance DB=postgresql TEST=mongo-go-driver
bin/task dance DB=ferretdb-postgresql TEST=mongo-go-driver
```

That command will run `mongo-go-driver` tests against FerretDB with PostgreSQL backend.
`DB` environment variable should have the value `postgresql`, `sqlite`, or `mongodb`.
`DB` environment variable should have the value `ferretdb-postgresql`, `ferretdb-sqlite`, or `mongodb`.
It defines what tests are expected to pass and fail.
For example, see [mongo-go-driver tests configuration](https://github.com/FerretDB/dance/blob/main/tests/mongo-go-driver.yml).
`TEST` environment variable should have the value matching a YAML file in the `tests` directory, or be empty.
Expand All @@ -42,18 +42,18 @@ bin/task env-up DB=mongodb
```

That command will start MongoDB in Docker container.
Please note that running `bin/task dance DB=postgresql` after that would run tests against that MongoDB,
Please note that running `bin/task dance DB=ferretdb-postgresql` after that would run tests against that MongoDB,
but results would be compared against results expected for FerretDB.
In short, that would be wrong.

```sh
bin/task env-up DB=postgresql
bin/task env-up DB=ferretdb-postgresql
```

or

```sh
bin/task env-up DB=sqlite
bin/task env-up DB=ferretdb-sqlite
```

That command will start FerretDB with a specified backend from `ferretdb-local` Docker image.
Expand All @@ -78,7 +78,7 @@ For example if you wanted to add your Java application to dance, you would do th
4. Start the environment and test it locally before submitting a PR to ensure that it works correctly.
Refer to the above [section](#starting-environment-with-docker-compose)
on how to start the environment.
5. Run the test locally to verify the output `bin/task dance DB=postgresql TEST=my-app`.
5. Run the test locally to verify the output `bin/task dance DB=ferretdb-postgresql TEST=my-app`.
6. Submit a PR to with a title of the form "Add MyApp tests".

See an example [shell script](https://github.com/FerretDB/dance/blob/main/tests/java-example.sh)
Expand Down
4 changes: 2 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tasks:
- task: init-user
preconditions:
- sh: "test {{.DB}}"
msg: "Please set DB variable to one of `postgresql`, `sqlite`, or `mongodb`"
msg: "Please set DB variable to one of `ferretdb-postgresql`, `ferretdb-sqlite`, or `mongodb`"

env-pull:
cmds:
Expand Down Expand Up @@ -72,7 +72,7 @@ tasks:
- go run ../cmd/dance -db={{.DB}} -p={{.PARALLEL}} {{.TEST}}
preconditions:
- sh: "test {{.DB}}"
msg: "Please set DB variable to one of `postgresql`, `sqlite`, or `mongodb`"
msg: "Please set DB variable to one of `ferretdb-postgresql`, `ferretdb-sqlite`, or `mongodb`"

lint:
desc: "Run linters"
Expand Down
57 changes: 27 additions & 30 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
---
services:
postgresql:
mongodb:
build:
context: ./build/deps
dockerfile: mongo7.Dockerfile
command: --config /etc/mongod.conf
container_name: dance_mongodb
restart: unless-stopped
ulimits:
nproc: 64000
nofile:
soft: 64000
hard: 64000
ports:
- 27017:27017
environment:
# Always UTC+05:45. Set to catch timezone problems.
- TZ=Asia/Kathmandu
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./build/mongod.conf:/etc/mongod.conf

ferretdb-postgresql:
image: ${FERRETDB_IMAGE:-ferretdb-local}
container_name: dance_postgresql
restart: unless-stopped
Expand All @@ -11,13 +33,12 @@ services:
# Always UTC+05:45. Set to catch timezone problems.
- TZ=Asia/Kathmandu
- FERRETDB_HANDLER=postgresql
- FERRETDB_POSTGRESQL_URL=postgres://user@postgres:5432/dance
- FERRETDB_POSTGRESQL_URL=postgres://postgres_user:postgres_password@postgres:5432/dance
- FERRETDB_REPL_SET_NAME=rs0
- FERRETDB_TEST_ENABLE_NEW_AUTH=true
extra_hosts:
- "host.docker.internal:host-gateway"

sqlite:
ferretdb-sqlite:
image: ${FERRETDB_IMAGE:-ferretdb-local}
container_name: dance_sqlite
restart: unless-stopped
Expand All @@ -29,7 +50,6 @@ services:
- FERRETDB_HANDLER=sqlite
- FERRETDB_SQLITE_URL=file:/state/?_pragma=busy_timeout(20000)
- FERRETDB_REPL_SET_NAME=rs0
- FERRETDB_TEST_ENABLE_NEW_AUTH=true
extra_hosts:
- "host.docker.internal:host-gateway"

Expand All @@ -44,33 +64,10 @@ services:
environment:
# UTC−03:30/−02:30. Set to catch timezone problems.
- TZ=America/St_Johns
- POSTGRES_USER=user
- POSTGRES_USER=postgres_user
- POSTGRES_PASSWORD=postgres_password
- POSTGRES_DB=dance
- POSTGRES_HOST_AUTH_METHOD=trust

mongodb:
build:
context: ./build/deps
dockerfile: mongo7.Dockerfile
command: --config /etc/mongod.conf
container_name: dance_mongodb
restart: unless-stopped
ulimits:
nproc: 64000
nofile:
soft: 64000
hard: 64000
ports:
- 27017:27017
environment:
# Always UTC+05:45. Set to catch timezone problems.
- TZ=Asia/Kathmandu
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./build/mongod.conf:/etc/mongod.conf

# never started normally, used only for mongosh, mongodump, etc.
mongosh:
build:
context: ./build/deps
Expand Down
Loading

0 comments on commit 8449d70

Please sign in to comment.