diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index cc959656..49b41f1d 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -17,8 +17,6 @@ jobs: ports: - 27017:27017 env: - # MONGO_INITDB_ROOT_USERNAME: test - # MONGO_INITDB_ROOT_PASSWORD: password MONGO_INITDB_DATABASE: steam_test_1_8_x options: >- --health-cmd "echo 'db.runCommand("ping").ok' | mongosh --quiet" diff --git a/Rakefile b/Rakefile index 2e215e8b..d7a18f76 100755 --- a/Rakefile +++ b/Rakefile @@ -27,8 +27,10 @@ namespace :mongodb do `mv #{dump_path} #{db_path}` end - `mongo steam_test_1_8_x --eval "db.dropDatabase()" #{host}` - `mongorestore -d steam_test_1_8_x #{db_path} #{host}` + # NOTE: command to drop the database + # `mongo steam_test_1_8_x --eval "db.dropDatabase()" #{host}` + + `mongorestore --drop -d steam_test_1_8_x #{db_path} #{host}` puts "Done! Update now the spec/support/helpers.rb file by setting the new id of the site returned by the mongodb_site_id method" end diff --git a/spec/integration/adapters/mongodb_spec.rb b/spec/integration/adapters/mongodb_spec.rb index 9e4ffa65..2f68d314 100644 --- a/spec/integration/adapters/mongodb_spec.rb +++ b/spec/integration/adapters/mongodb_spec.rb @@ -43,7 +43,8 @@ end def current_connections - `mongosh --eval "db.serverStatus().connections.current"`.split("\n").last.to_i + stats = JSON.parse(`mongostat --noheaders -n 1 --json`) + stats.dig('localhost', 'conn')&.to_i end end