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

Use Mage as build tool #111

Merged
merged 8 commits into from
Aug 14, 2022
Merged

Use Mage as build tool #111

merged 8 commits into from
Aug 14, 2022

Conversation

philippgille
Copy link
Owner

@philippgille philippgille commented Aug 14, 2022

With this PR we migrate from the Bash and PowerShell scripts for building/testing to Mage. This way it doesn't matter anymore on which platform you work with gokv - instead of running either the PowerShell or the Bash script, mage <target> should always work.

Some build targets still make use of pre-existing scripts, but others are replaced:

  • mage update runs the existing build/update-deps.ps1/.sh scripts for updating the dependencies of all modules
  • mage build builds all modules via existing build/build.ps1/.sh scripts
  • mage test ... is a full reimplementation of build/test.sh in Go / in the magefile. There was no PowerShell script for running the tests on Windows, so this is a big win.
    • mage test all keeps the old behavior of testing all modules
    • mage test redis (or similar) tests just the given module, which was not implemented in the Bash script
  • mage clean deletes any code coverage output files

Some scripts were simply removed and we don't need Mage targets for them:

  • combine-coverage.sh isn't necessary anymore. It seems that when coverage.txt files are present in various directories, Codecov can now handle all of them, without us having to combine them into a single file first
  • tidy.ps1 is not used anymore. The update-deps scripts already include a tidy step.

@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2022

Codecov Report

Merging #111 (e754196) into master (93b870d) will decrease coverage by 9.42%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #111      +/-   ##
==========================================
- Coverage   77.14%   67.71%   -9.43%     
==========================================
  Files          22       24       +2     
  Lines        1750     2057     +307     
==========================================
+ Hits         1350     1393      +43     
- Misses        270      534     +264     
  Partials      130      130              
Impacted Files Coverage Δ
tablestorage/tablestorage.go 28.10% <0.00%> (ø)
tablestore/tablestore.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippgille philippgille marked this pull request as ready for review August 14, 2022 18:18
@philippgille
Copy link
Owner Author

philippgille commented Aug 14, 2022

The builds and tests are 🟢 .
Codecov is 🔴 because we now run tests for the tablestorage and tablestore modules, which didn't run before. While having some tablestorage tests increases the coverage from a global point of view, Codecov first calculates individual coverages and then averages them, and the tablestorage coverage is low because the regular tests don't work with Azurite yet and are skipped, and the tablestore ones are skipped entirely, so with only a low coverage for two modules it drags down the average coverage, which is what Codecov focuses on.

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.

2 participants