Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Traffic Monitor Integration Test Framework#5817

Merged
zrhoffman merged 22 commits intoapache:masterfrom
shamrickus:tm/integration-tests
May 28, 2021
Merged

Traffic Monitor Integration Test Framework#5817
zrhoffman merged 22 commits intoapache:masterfrom
shamrickus:tm/integration-tests

Conversation

@shamrickus
Copy link
Copy Markdown
Member

What does this PR (Pull Request) do?

  • This PR is not related to any Issue

It is based off of #3707 and includes fixes for dual homing changes as well as addressing the feedback posted on the previous PR.

Also adds a TM client as well for use in the tests.

Which Traffic Control components are affected by this PR?

  • Traffic Monitor
  • CI tests

What is the best way to verify this PR?

Run the integration tests by following the instructions found in the tests/_integration/README.md.
Should also verify that @zrhoffman's comments on the previous PR have been addressed.

If this is a bug fix, what versions of Traffic Control are affected?

The following criteria are ALL met by this PR

  • This PR includes tests OR I have explained why tests are unnecessary
  • This PR includes documentation OR I have explained why documentation is unnecessary
  • This PR includes an update to CHANGELOG.md OR such an update is not necessary
  • This PR includes any and all required license headers
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY (see the Apache Software Foundation's security guidelines for details)

Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

A lot of the TM integration test Docker environment seems to be copied from an older version of CDN in a Box.
I can understand only wanting to build and use the pieces that are relevant for the TM integration tests, but using CDN in a Box where it sits instead of copying it does not require starting everything. For example, neither the TO integration tests nor the TP integration tests require starting all of the CDN in a Box services:

# docker-compose -f docker-compose.yml -f docker-compose.traffic-ops-test.yml up -d edge enroller dns db smtp trafficops trafficvault integration
# docker-compose -f docker-compose.traffic-ops-test.yml logs -f integration

# docker-compose -f docker-compose.yml -f docker-compose.traffic-portal-test.yml up -d db edge trafficportal trafficops trafficvault portal-integration-test
# docker-compose -f docker-compose.traffic-portal-test.yml logs -f portal-integration-test

Comment thread traffic_monitor/tests/integration/docker-compose.yml Outdated
Comment thread traffic_monitor/tests/integration/kbps_test.go Outdated
Comment thread traffic_monitor/tests/integration/traffic_monitor_test.go Outdated
Comment thread traffic_monitor/tests/integration/traffic_monitor_test.go Outdated
Comment thread traffic_monitor/tools/testcaches/Dockerfile Outdated
Comment thread traffic_monitor/tests/integration/Dockerfile Outdated
Comment thread traffic_monitor/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/integration/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/integration/client_test.go Outdated
Comment thread traffic_monitor/tests/integration/config/config.go Outdated
@rob05c
Copy link
Copy Markdown
Member

rob05c commented May 8, 2021

A lot of the TM integration test Docker environment seems to be copied from an older version of CDN in a Box.

For the record, it is not. It's based on #3707 whose compose was written from scratch. I believe the Dockerfiles may have been based on the independent dockerfiles in infrastructure/docker (which I also originally wrote), but neither they nor the docker-compose.yml are derivative works of the CDN-in-a-Box.

@shamrickus
Copy link
Copy Markdown
Member Author

A lot of the TM integration test Docker environment seems to be copied from an older version of CDN in a Box.
I can understand only wanting to build and use the pieces that are relevant for the TM integration tests, but using CDN in a Box where it sits instead of copying it does not require starting everything. For example, neither the TO integration tests nor the TP integration tests require starting all of the CDN in a Box services:

# docker-compose -f docker-compose.yml -f docker-compose.traffic-ops-test.yml up -d edge enroller dns db smtp trafficops trafficvault integration
# docker-compose -f docker-compose.traffic-ops-test.yml logs -f integration

# docker-compose -f docker-compose.yml -f docker-compose.traffic-portal-test.yml up -d db edge trafficportal trafficops trafficvault portal-integration-test
# docker-compose -f docker-compose.traffic-portal-test.yml logs -f portal-integration-test

I agree it'd be better for that, but I was going off of what Rob already did. I figured it would be more valuable to get this merged and working, and then later down the road it can be moved to CiaB (testcaches would also need to be ported). That also has the added benefit of building and running this currently only takes about as long as it does to build just TM.

@zrhoffman
Copy link
Copy Markdown
Member

A lot of the TM integration test Docker environment seems to be copied from an older version of CDN in a Box.

For the record, it is not. It's based on #3707 whose compose was written from scratch. I believe the Dockerfiles may have been based on the independent dockerfiles in infrastructure/docker (which I also originally wrote), but neither they nor the docker-compose.yml are derivative works of the CDN-in-a-Box.

Fair enough, we don't really group things based on infrastructure/docker like we do CDN in a Box, and it's not a ton of code duplication.

Comment thread traffic_monitor/tools/testto/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/_integration/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/_integration/Dockerfile Outdated
Comment thread traffic_monitor/Dockerfile Outdated
Comment thread traffic_monitor/tools/testto/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/_integration/traffic_monitor_test.go Outdated
Comment thread traffic_monitor/health/event.go Outdated
Comment thread traffic_monitor/tests/_integration/kbps_test.go Outdated
Comment thread traffic_monitor/tmclient/tmclient.go Outdated
Comment thread traffic_monitor/tools/testcaches/fakesrvrdata/run.go Outdated
Comment thread traffic_monitor/tests/_integration/kbps_test.go Outdated
Comment thread traffic_monitor/tmclient/tmclient.go Outdated
Comment thread traffic_monitor/build_tests.sh Outdated
Comment thread traffic_monitor/build_tests.sh Outdated
Comment thread traffic_monitor/build_tests.sh Outdated
Comment thread traffic_monitor/tests/_integration/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/Dockerfile_run.sh Outdated
Comment thread traffic_monitor/tests/_integration/README.md Outdated
Comment thread traffic_monitor/tests/_integration/traffic_monitor_test.go Outdated
Comment thread traffic_monitor/tests/_integration/client_test.go Outdated
Comment thread traffic_monitor/variables.env Outdated
Comment thread traffic_monitor/Dockerfile Outdated
Copy link
Copy Markdown
Member

@zrhoffman zrhoffman left a comment

Choose a reason for hiding this comment

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

Builds with minimal manual steps, and tests pass!

@zrhoffman zrhoffman merged commit 60a9ffd into apache:master May 28, 2021
@rawlinp rawlinp added tests related to tests and/or testing infrastructure Traffic Monitor related to Traffic Monitor labels May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tests related to tests and/or testing infrastructure Traffic Monitor related to Traffic Monitor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants