Skip to content
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
akavel merged 5 commits intomasterfrom
tests-preamble
Mar 20, 2020
Merged

tests/e2e: refactor common preamble into separate function#325
akavel merged 5 commits intomasterfrom
tests-preamble

Conversation

@akavel
Copy link
Copy Markdown

@akavel akavel commented Mar 18, 2020

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.sh script 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

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Unit tests and e2e tests updated
  • Documentation updatedN/A

Mateusz Czapliński 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.
@akavel akavel requested a review from mkyc March 18, 2020 16:57
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 18, 2020

Codecov Report

Merging #325 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #325   +/-   ##
=======================================
  Coverage   24.76%   24.76%           
=======================================
  Files           6        6           
  Lines         529      529           
=======================================
  Hits          131      131           
  Misses        368      368           
  Partials       30       30

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 a4d5e78...19b6a7c. Read the comment docs.

@akavel akavel requested a review from vinny-sabatini March 19, 2020 13:44
Copy link
Copy Markdown

@mkyc mkyc left a comment

Choose a reason for hiding this comment

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

I really tried to find something worth requesting changes but that is one of those perfectly well done and boringly good PRs. LGTM :)

@akavel akavel merged commit 98a3f5b into master Mar 20, 2020
@akavel akavel deleted the tests-preamble branch March 20, 2020 13:37
@seanmalloy seanmalloy added this to the v0.1.6 milestone Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Refactor "test initialization" into separate function

3 participants