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

test(infra): improved support for in-process testing #2169

Merged
merged 3 commits into from
Jul 10, 2022

Conversation

jkowalski
Copy link
Contributor

@jkowalski jkowalski commented Jul 9, 2022

We currently don't have full picture of test coverage because some tests run kopia in out-of-process mode where code coverage is not collected.

This PR fixes this by making many more test cases runnable in-process. With this change almost all tests run in make test and make integration-tests is reduced to just a handful which will be moved next.

  • support for killing of a running server using simulated Ctrl-C
  • support for overriding os.Stdin
  • support for passing environment variables to instances of Kopia in the same process - this is achieved by giving each instance of kopia their own environment variable prefix
  • migrated many tests from the exe runner to in-process runner

* support for killing of a running server using simulated Ctrl-C
* support for overriding os.Stdin
* migrated many tests from the exe runner to in-process runner
@jkowalski jkowalski force-pushed the inproc-testability branch 4 times, most recently from 6718071 to a561d4e Compare July 9, 2022 21:21
@codecov
Copy link

codecov bot commented Jul 9, 2022

Codecov Report

Merging #2169 (3558a2e) into master (a621cd3) will increase coverage by 0.86%.
The diff coverage is 96.55%.

@@            Coverage Diff             @@
##           master    #2169      +/-   ##
==========================================
+ Coverage   73.73%   74.59%   +0.86%     
==========================================
  Files         425      425              
  Lines       33006    33029      +23     
==========================================
+ Hits        24337    24639     +302     
+ Misses       6885     6607     -278     
+ Partials     1784     1783       -1     
Impacted Files Coverage Δ
cli/command_snapshot_migrate.go 52.83% <0.00%> (ø)
cli/storage_providers.go 100.00% <ø> (ø)
cli/update_check.go 14.83% <0.00%> (+1.93%) ⬆️
cli/command_mount.go 20.98% <50.00%> (+0.98%) ⬆️
cli/config.go 76.81% <90.00%> (+0.24%) ⬆️
cli/app.go 80.39% <100.00%> (+1.39%) ⬆️
cli/command_diff.go 63.63% <100.00%> (ø)
cli/command_repository_change_password.go 66.66% <100.00%> (ø)
cli/command_repository_connect.go 91.78% <100.00%> (ø)
cli/command_repository_create.go 72.03% <100.00%> (ø)
... and 53 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a621cd3...3558a2e. Read the comment docs.

@jkowalski jkowalski enabled auto-merge (squash) July 9, 2022 21:34
@jkowalski jkowalski disabled auto-merge July 9, 2022 21:34
@jkowalski jkowalski force-pushed the inproc-testability branch 2 times, most recently from 4fa708d to 2978b1b Compare July 9, 2022 22:11
@jkowalski jkowalski merged commit 8515d05 into kopia:master Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant