Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Add demo book app watcher for terminal and raw JSON from web API #3930

Merged
merged 4 commits into from
Aug 9, 2021

Conversation

trstringer
Copy link
Contributor

Description:

When I'm testing or demo'ing OSM, I am in the terminal. The demo app requires you to use the browser or curl the markup of the different services (bookbuyer, bookthief, etc.). This is very manual and requires some visual grep'ing as well as manual refreshing.

This PR adds a /raw route to bookbuyer, bookthief, and bookstore to get their JSON data. It also adds a bookwatcher bin that polls the different raw endpoints and displays the output. The text color is as follows:

  • Yellow - data hasn't changed since last poll iteration
  • Green - data for bookbuyer and bookstore has changed
  • Red - books were stolen by the bookthief since last poll iteration

This refreshes the terminal every second. Below are screenshots showing the experience.

Affected area:

Functional Area
Demo [X]

Testing done:

osm_demo_bookbuyer1

This shows that since the last iteration, the bookbuyer has bought a book (or books) and the bookstore V1 has sold a book (or books).

osm_demo_bookthief1

This shows that since the last iteration, the bookthief has stolen a book (or books) and bookstore V1 has sold a book (or books).

Please answer the following questions with yes/no.

  1. Does this change contain code from or inspired by another project?

No.

  1. Is this a breaking change?

No.

@trstringer trstringer requested a review from a team as a code owner August 6, 2021 19:19
@codecov-commenter
Copy link

codecov-commenter commented Aug 6, 2021

Codecov Report

Merging #3930 (c07dad1) into main (8ed34b1) will decrease coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3930      +/-   ##
==========================================
- Coverage   67.61%   67.49%   -0.12%     
==========================================
  Files         202      202              
  Lines       11504    11543      +39     
==========================================
+ Hits         7778     7791      +13     
- Misses       3676     3702      +26     
  Partials       50       50              
Flag Coverage Δ
unittests 67.49% <ø> (-0.12%) ⬇️

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

Impacted Files Coverage Δ
cmd/init-osm-controller/init-osm-controller.go
cmd/osm-bootstrap/osm-bootstrap.go 33.64% <0.00%> (ø)
cmd/osm-controller/osm-controller.go 14.01% <0.00%> (+0.43%) ⬆️
pkg/envoy/rds/route/route_config.go 100.00% <0.00%> (+3.64%) ⬆️

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 8ed34b1...c07dad1. Read the comment docs.

Signed-off-by: Thomas Stringer <thstring@microsoft.com>
Signed-off-by: Thomas Stringer <thstring@microsoft.com>
Signed-off-by: Thomas Stringer <thstring@microsoft.com>
@trstringer trstringer force-pushed the thstring/demo-terminal branch from ef02f4a to 5456680 Compare August 6, 2021 19:53
Signed-off-by: Thomas Stringer <thstring@microsoft.com>
@trstringer trstringer merged commit 3f53acc into openservicemesh:main Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants