This repository was archived by the owner on Mar 11, 2022. It is now read-only.
tests/e2e: refactor common preamble into separate function#325
Merged
tests/e2e: refactor common preamble into separate function#325
Conversation
added 4 commits
March 18, 2020 17:48
Extract the preamble code commonly used in almost all e2e tests into a helper function NewContext. The function returns a struct wrapping the values that were previously stored in local variables. Related to #214
Use NewContext function in e2e tests instead of the commonly repeated preamble. Fixes #214.
The 'shellcheck' command in Makefile was done incorrectly: - errors from the command were ignored, because it was wrapped in a 'for' loop. Only a failure on the last file checked would result in loop's failure and a Makefile error - the files from the ./ci/ directory were checked as part of CI. They are a third-party subrepo (a script we need for openshift CI), so we don't want to check and fix them.
Optimize `git clone` to do a shallow copy of the repository only (just the newest commit). Template processors aren't expected to need access to git history, so this is a small "drive by" optimization of space, transfers, and time.
Codecov Report
@@ Coverage Diff @@
## master #325 +/- ##
=======================================
Coverage 24.76% 24.76%
=======================================
Files 6 6
Lines 529 529
=======================================
Hits 131 131
Misses 368 368
Partials 30 30Continue to review full report at Codecov.
|
mkyc
approved these changes
Mar 19, 2020
mkyc
left a comment
There was a problem hiding this comment.
I really tried to find something worth requesting changes but that is one of those perfectly well done and boringly good PRs. LGTM :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactor the code commonly repeated at the beginning of most e2e tests into a separate function, and modify the tests to use the helper function.
Fixes #214
Also, change the
template-processors/base/bin/gitClone.shscript to only do a shallow git clone (skip downloading and cloning full git history of the repositories, keep only the state at last commit).Type of change
Checklist
Documentation updated— N/A