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

devcontainer & unit test refactoring #1220

Merged
merged 39 commits into from
Nov 11, 2023

Conversation

kwitsch
Copy link
Collaborator

@kwitsch kwitsch commented Oct 31, 2023

Devcontainer changes:

  • removed slow extensions
  • corrected autolinting
  • added test extensions
  • added lcov converter
  • added volume for go package caching
  • added task & launch configurations

Unit test changes:

  • surrounded improper sections with BeforeEach
  • fixed local variables by declaring them in a parent section
  • use dedicated ports for each runner if tests are executed parallel

Workflow changes:

  • disabled coverage upload on forks

Makefile changes:

  • runs test and race with -p if GINKGO_PROCS isn't specified

@kwitsch kwitsch added the 🧰 technical debts Technical debts, refactoring label Oct 31, 2023
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

see 2 files with indirect coverage changes

📢 Thoughts on this report? Let us know!

@kwitsch kwitsch mentioned this pull request Oct 31, 2023
@kwitsch kwitsch enabled auto-merge (squash) October 31, 2023 23:34
@kwitsch kwitsch disabled auto-merge November 3, 2023 19:57
@kwitsch
Copy link
Collaborator Author

kwitsch commented Nov 3, 2023

Thought of a better way to achieve automatic background testing.
Will push it after testing.

@kwitsch kwitsch marked this pull request as draft November 4, 2023 13:30
@kwitsch kwitsch changed the title devcontainer extension devcontainer & unit test refactoring Nov 5, 2023
@kwitsch kwitsch marked this pull request as ready for review November 11, 2023 01:58
@kwitsch
Copy link
Collaborator Author

kwitsch commented Nov 11, 2023

@0xERR0R & @ThinkChaos I started refactoring the unit tests in this PR to enable parallel execution. Since this is still flaky I disabled it in GitHub workflow execution. The GitHub runners provide 2 cores therefore enabling -p speeds test and race by only <1 minute during workflow execution.
Running make test locally with 8< cores the performance increase is significant.

I fixed the most problematic parts but there are still way too many local variables which are against the ginkgo principal (variables shouldn't be declared inside the deepest level). Also initialization should be done outside the test itself in BeforeEach, BeforeAll, etc.

I enabled parallel execution in make test and make race therefore these are flaky locally which helps identify the problematic tests so they can be fixed gradually.

@kwitsch kwitsch enabled auto-merge (squash) November 11, 2023 02:28
Copy link
Collaborator

@ThinkChaos ThinkChaos left a comment

Choose a reason for hiding this comment

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

Looks good to me. The port thing doesn't necessarily need to be changed now, do as you wish :)

cmd/serve_test.go Show resolved Hide resolved
@kwitsch kwitsch merged commit 8ece708 into 0xERR0R:main Nov 11, 2023
3 checks passed
@kwitsch kwitsch deleted the feature/devcontainer-extension branch November 11, 2023 16:58
@0xERR0R 0xERR0R added this to the v0.23 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧰 technical debts Technical debts, refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants