jaegertracing / jaeger

CNCF Jaeger, a Distributed Tracing Platform
https://www.jaegertracing.io/
Apache License 2.0
20.52k stars 2.44k forks source link

Simplify Bundling of UI assets #5917

Closed mahadzaryab1 closed 2 months ago

mahadzaryab1 commented 2 months ago

Which problem is this PR solving?

Description of the changes

How was this change tested?

Added unit tests and performed the following manual tests

Test 1

Makefile Target

.PHONY: run-all-in-one
run-all-in-one:
    go run ./cmd/all-in-one --log-level debug

Clearing out the actual directory and ran make run-all-in-one. Going to http://localhost:16686/ renders the placeholder HTML page.

Test 2

Makefile Target

.PHONY: run-all-in-one
run-all-in-one: build-ui
    go run ./cmd/all-in-one --log-level debug

Ran make run-all-in-one. Going to http://localhost:16686/ renders the Jaeger UI.

Checklist

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.81%. Comparing base (5bd6980) to head (2b62656). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #5917 +/- ## ======================================= Coverage 96.81% 96.81% ======================================= Files 342 343 +1 Lines 16525 16528 +3 ======================================= + Hits 15998 16001 +3 Misses 340 340 Partials 187 187 ``` | [Flag](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | Coverage Δ | | |---|---|---| | [badger_v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `8.05% <ø> (ø)` | | | [badger_v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.82% <ø> (ø)` | | | [cassandra-3.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `16.62% <ø> (ø)` | | | [cassandra-3.x-v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.75% <ø> (ø)` | | | [cassandra-4.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `16.62% <ø> (ø)` | | | [cassandra-4.x-v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.75% <ø> (ø)` | | | [elasticsearch-6.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `18.78% <ø> (ø)` | | | [elasticsearch-7.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `18.85% <ø> (ø)` | | | [elasticsearch-8.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `19.03% <ø> (ø)` | | | [elasticsearch-8.x-v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.82% <ø> (ø)` | | | [grpc_v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `9.49% <ø> (ø)` | | | [grpc_v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `7.16% <ø> (ø)` | | | [kafka-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `9.74% <ø> (ø)` | | | [kafka-v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.82% <ø> (ø)` | | | [memory_v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.82% <ø> (+0.01%)` | :arrow_up: | | [opensearch-1.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `18.89% <ø> (-0.02%)` | :arrow_down: | | [opensearch-2.x-v1](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `18.90% <ø> (ø)` | | | [opensearch-2.x-v2](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `1.82% <ø> (+0.01%)` | :arrow_up: | | [tailsampling-processor](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `0.46% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/jaegertracing/jaeger/pull/5917/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing) | `95.29% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jaegertracing#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mahadzaryab1 commented 2 months ago

@yurishkuro anything we can do about the failing codecoverage step?

yurishkuro commented 2 months ago

you could have another test where you swap actualFS for a test fixture, e.g.

ui/testdata/
  actual/
    index.html.gz -- dummy file
  mock.go // embed fake actual here
mahadzaryab1 commented 2 months ago

you could have another test where you swap actualFS for a test fixture, e.g.

ui/testdata/
  actual/
    index.html.gz -- dummy file
  mock.go // embed fake actual here

thanks for the suggestion! I added a second test in.

yurishkuro commented 2 months ago

Thanks!