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

Allow to run tests in local environment + fix tests for it #762

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

atercattus
Copy link
Member

We can run our tests on CI stage (github actions). But it's difficult for local usage 😅

Now I'm working on #650 and I really need tests locally.
I'm trying to use act, but it's not working for me.
So I wrote a docker env for it. Also, I did tiny refactoring and fixes in tests for it.

All we need to run tests is simple $ make test-local.

RUN go mod download
COPY ./ .

CMD go test -race -v -timeout 2m ./... -gocheck.v
Copy link
Collaborator

@lance6716 lance6716 Jan 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about your environment. The first thought comes to my mind is using docker to start a MySQL at 3306 and running go test outside the docker. The good point is if I change some code, I don't need to build the docker image again and no need to prune unused docker local volumes periodically. (in last week I found my disk is almost full, docker volumns of another project's integration tests occupied ~200GB 😂 )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Ok. I'll do this.

@atercattus atercattus force-pushed the atercattus/allow-to-run-tests-in-local-docker branch from 4d252f2 to 9e7980a Compare January 13, 2023 10:24
@lance6716 lance6716 merged commit c4a17aa into master Jan 16, 2023
@atercattus atercattus deleted the atercattus/allow-to-run-tests-in-local-docker branch January 16, 2023 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants