Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

test: add Mongo Asset's unit testing #141

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

KeisukeYamashita
Copy link
Contributor

Overview

I have added initial unit testing for MongoDB based on this issue 👉 reearth/reearth-visualizer#273.
See details (requirements) in that issue.

I implemented one for a trial to avoid conflicts and decide how we are going to test this method.

What I've done

I have added a unit test for the Asset repository's Remove method.

What I haven't done

Add unit tests for other methods.

How I tested

The testings are done by the CI GitHub Actions workflow.
This can be also tested locally.

# Skip testing
go test -timeout 30s -run '^TestFindByID$' github.com/reearth/reearth-backend/internal/infrastructure/mongo

# Test (after launching MongoDB instance in your local environment)
REEARTH_DB=mongodb://localhost go test -timeout 30s -run '^TestFindByID$' github.com/reearth/reearth-backend/internal/infrastructure/mongo

Which point I want you to review particularly

  • How the testing(s) should be done

Memo

FYI: This PR is on top of this PR #139

Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
@KeisukeYamashita KeisukeYamashita self-assigned this May 10, 2022
@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #141 (9b3ac0e) into main (4f72b87) will decrease coverage by 2.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
- Coverage   36.68%   34.64%   -2.04%     
==========================================
  Files         331      349      +18     
  Lines       29890    31755    +1865     
==========================================
+ Hits        10964    11001      +37     
- Misses      17925    19752    +1827     
- Partials     1001     1002       +1     
Impacted Files Coverage Δ
internal/infrastructure/mongo/property_schema.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/project.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/scene.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/auth_request.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/team.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/config.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/transaction.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/tag.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/dataset.go 0.00% <0.00%> (ø)
internal/infrastructure/mongo/plugin.go 0.00% <0.00%> (ø)
... and 8 more

@KeisukeYamashita KeisukeYamashita changed the base branch from test-mongo-asset-findbyid to main May 10, 2022 14:20
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
@KeisukeYamashita KeisukeYamashita changed the title test: add Mongo Asset's Remove unit testing test: add Mongo Asset's Remove unit testing May 10, 2022
@KeisukeYamashita KeisukeYamashita changed the title test: add Mongo Asset's Remove unit testing test: add Mongo Asset's unit testing May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant