Skip to content

Commit

Permalink
test: test_nshm_wishlist db test
Browse files Browse the repository at this point in the history
  • Loading branch information
amber committed Oct 19, 2024
1 parent 0aca5a0 commit d67ad80
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-wishlist-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
echo "MongoDB is ready!"
# Check for users in the test_nshm_wishlist database
echo "Listing users in the test_nshm_wishlist database:"
docker exec mongo mongosh -u test_user -p test_password --authenticationDatabase admin --eval "use test_nshm_wishlist; db.getUsers()"
docker exec mongo mongosh -u test_user -p test_password --authenticationDatabase test_nshm_wishlist --eval "use test_nshm_wishlist; db.getUsers()"
break
fi
echo "Waiting for MongoDB to be ready..."
Expand Down
12 changes: 0 additions & 12 deletions services/wishlist/database/test/1-schema.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
db = db.getSiblingDB('admin');

db.createUser({
user: "test_user",
pwd: "test_password", // Use the same password as the root user
roles: [
{ role: "readWrite", db: "test_nshm_wishlist" } // Assign appropriate role
]
});

// Switch to the target database
db = db.getSiblingDB('test_nshm_wishlist');
// Create 'wishlist' collection (if it doesn't exist yet)
db.createCollection("wishlist");

Expand Down

0 comments on commit d67ad80

Please sign in to comment.