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

Create stepimplementer for NPM UT and UAT #227

Merged
merged 3 commits into from
Oct 13, 2021

Conversation

kharyam
Copy link
Contributor

@kharyam kharyam commented Oct 1, 2021

Purpose

Adding stepimplementers for NPM Unit Tests and User Acceptance Tests.

Since NPM is not standardized to the same degree as maven, the following implementation has been used:

  • The npm commands used to run the UT / UAT steps are configurable but default to "test" and "test:uat" respectively.
  • Making the assumption that the tests will be configured via environment variables. Key-value pairs will be passed to the stepimplementer and used to set env vars.
  • The UAT step will require an endpoint to test against. A dedicated parameter will specify the name of an environment variable to set with the deployed application endpoint
  • The test step will generate "xunit" formatted test results that can be parsed by this step implementer

Example Config:

unit-test:
- implementer: NpmXunitTest
  config:
    test-reports-dir: test_results

uat:
- implementer: NpmXunitIntegrationTest
  config:
    target-host-env-var-name: APP_ROUTE
    test-reports-dir: uat-reports
    npm-envs:
       WEB_DRIVER_URL: http://selenium-grid.devsecops:4444/wd/hub
       BROWSER: chrome
       USER1: test1
       USER2: test2

Breaking?

No

Integration Testing

Performed integration testing in a client's environment. Future: update ploigos npm reference app and implement a UAT step.

@codecov
Copy link

codecov bot commented Oct 1, 2021

Codecov Report

Merging #227 (742c10e) into main (f192def) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              main      #227    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           87        91     +4     
  Lines         3559      3674   +115     
==========================================
+ Hits          3559      3674   +115     
Flag Coverage Δ
pytests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/ploigos_step_runner/__init__.py 100.00% <ø> (ø)
...er/step_implementers/uat/maven_integration_test.py 100.00% <ø> (ø)
...tep_runner/step_implementers/unit_test/tox_test.py 100.00% <ø> (ø)
...s_step_runner/step_implementers/shared/__init__.py 100.00% <100.00%> (ø)
...tep_runner/step_implementers/shared/npm_generic.py 100.00% <100.00%> (ø)
...nner/step_implementers/shared/npm_xunit_generic.py 100.00% <100.00%> (ø)
...step_implementers/static_code_analysis/__init__.py 100.00% <100.00%> (ø)
...step_implementers/static_code_analysis/tox_lint.py 100.00% <100.00%> (ø)
...igos_step_runner/step_implementers/uat/__init__.py 100.00% <100.00%> (ø)
...tep_implementers/uat/npm_xunit_integration_test.py 100.00% <100.00%> (ø)
... and 3 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 871b950...742c10e. Read the comment docs.

@kharyam kharyam changed the title WIP: Create stepimplementer for NPM UAT Create stepimplementer for NPM UAT Oct 1, 2021
@itewk
Copy link
Contributor

itewk commented Oct 4, 2021

@kharyam can you squash your commits?

@itewk
Copy link
Contributor

itewk commented Oct 4, 2021

@kharyam can you confirm you have tested this in some integration type scenario?

@kharyam kharyam force-pushed the feature/npm-uat branch 2 times, most recently from 8ce4475 to aa2361b Compare October 6, 2021 20:07
@itewk
Copy link
Contributor

itewk commented Oct 7, 2021

@kharyam is this ready for review or should it be put in WIP status?

@kharyam kharyam force-pushed the feature/npm-uat branch 3 times, most recently from 2a6e4eb to 1961826 Compare October 7, 2021 18:13
@kharyam kharyam changed the title Create stepimplementer for NPM UAT WIP Create stepimplementer for NPM UAT Oct 12, 2021
@kharyam kharyam changed the title WIP Create stepimplementer for NPM UAT WIP: Create stepimplementer for NPM UAT Oct 12, 2021
@kharyam kharyam changed the title WIP: Create stepimplementer for NPM UAT WIP: Create stepimplementer for NPM UT and UAT Oct 12, 2021
@kharyam kharyam changed the title WIP: Create stepimplementer for NPM UT and UAT Create stepimplementer for NPM UT and UAT Oct 12, 2021
@kharyam
Copy link
Contributor Author

kharyam commented Oct 12, 2021

@itewk This one is ready for review. It has been tested in a client's environment. I plan on updating the reference NPM app "at some point" to use this.

@itewk
Copy link
Contributor

itewk commented Oct 12, 2021

@kharyam can you rebase on main, i think you accidenlty squashed in some old changes or something from a previous version of main.

@kharyam
Copy link
Contributor Author

kharyam commented Oct 12, 2021

@kharyam can you rebase on main, i think you accidenlty squashed in some old changes or something from a previous version of main.
@itewk oopsie - should be good now.

@itewk itewk merged commit 5bb4516 into ploigos:main Oct 13, 2021
@itewk
Copy link
Contributor

itewk commented Oct 13, 2021

@kharyam thanks.

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