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

feat: Add TF versions updater #629

Merged
merged 7 commits into from
Nov 17, 2020
Merged

feat: Add TF versions updater #629

merged 7 commits into from
Nov 17, 2020

Conversation

bharathkkb
Copy link
Contributor

Fixes #628

/cc @morgante

@bharathkkb bharathkkb requested a review from a team as a code owner November 16, 2020 16:30
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Nov 16, 2020
@codecov
Copy link

codecov bot commented Nov 16, 2020

Codecov Report

Merging #629 (814d312) into master (cc7f39a) will increase coverage by 1.26%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #629      +/-   ##
==========================================
+ Coverage   80.73%   81.99%   +1.26%     
==========================================
  Files          45       46       +1     
  Lines        5418     5477      +59     
  Branches      410      441      +31     
==========================================
+ Hits         4374     4491     +117     
+ Misses       1043      985      -58     
  Partials        1        1              
Impacted Files Coverage Δ
src/releasers/terraform-module.ts 91.30% <100.00%> (+58.63%) ⬆️
src/updaters/terraform/module-version.ts 100.00% <100.00%> (ø)

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 cc7f39a...814d312. Read the comment docs.


const fixturesPath = './test/updaters/fixtures';

describe('versions.tf', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@bharathkkb Can we add a test fixture for a submodule?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@morgante sg, currently logic for submodule is in the releaser so we may need to add a test there.

// A module may have submodules, so find all versions.tf to update.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bharathkkb when adding tests for releasers, take a look at these tests:

https://github.com/googleapis/release-please/blob/master/test/releasers/simple.ts#L43

I've been switching to using sinon and mocking for tests, rather than nock (_which requires you enumerate every HTTP endpoint you hit with the GitHub API). I think you'll find sinon easier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@morgante @bcoe added some tests primarily testing the behavior for modules, modules+sub modules and backward compatibility if no versions.tf or module versions defined.

src/releasers/terraform-module.ts Show resolved Hide resolved
test/releasers/terraform-module.ts Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updater for module version in versions.tf
3 participants