Skip to content

Conversation

@cmcfarlen
Copy link
Contributor

This allows running autest with a cmake target. It also provides a helper script to run it again for iterative development. I imagine CI will use the target while a developer would use the target to set it up for them and then use the script with filters to iterate on creating tests.

I tried to install trafficserver with DESTDIR and run autest that way but traffic_layout returns the wrong paths in this case so that will have to get sorted if we want that to work. Just throwing ats in /tmp seems just fine, and CI builds don't really need this feature.

This does build the test plugins out of source now, so no more .libs directories in the source tree.

The helper script ends up at ${CMAKE_BINARY_DIRECTORY}/tests/autest.sh. It has all of the options for resolving ats bin and everything but you can add additional options to filter output etc.

$ cmake -B test-autest-build -GNinja -DENABLE_AUTEST=ON -DCMAKE_INSTALL_PREFIX=/tmp/ats-autest .
... build generation, proxy-verifier install, python/pipenv detection
$ cmake --build test-autest-build --target autest
... build project, install, pipenv install, autest
$ cd cmake-autest-build/tests
$ ./autest.sh --filter TSVConnFd
Running Test TSVConnFd:.. Passed

Generating Report: --------------
Total of 1 test
  Unknown: 0
  Exception: 0
  Failed: 0
  Warning: 0
  Skipped: 0
  Passed: 1

The status of autest builds with cmake is still quite poor, but at least this will get us all going to get those fixed.

@cmcfarlen cmcfarlen added the CMake work related to CMakes scripts or issues label Sep 1, 2023
@cmcfarlen cmcfarlen added this to the 10.0.0 milestone Sep 1, 2023
@cmcfarlen cmcfarlen self-assigned this Sep 1, 2023
Copy link
Contributor

@bneradt bneradt left a comment

Choose a reason for hiding this comment

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

Looks promising.

Comment on lines +328 to +329
set(PROXY_VERIFIER_VERSION "v2.10.1")
set(PROXY_VERIFIER_HASH "SHA1=0f189a37596d7488b5b81b5547df6fc1eadf56a1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Kind of handy to have these both specified here.

@cmcfarlen cmcfarlen marked this pull request as ready for review September 1, 2023 22:28
@cmcfarlen cmcfarlen merged commit cd3a3ea into apache:master Sep 5, 2023
@cmcfarlen cmcfarlen deleted the cmake-autest branch September 5, 2023 00:08
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
* asf/master: (22 commits)
  fix: check whether a protocol is enabled during the length calculation in create_npn_advertisement (apache#10381)
  Coverity 1518612: Remove dead code (apache#10384)
  prefetch_cmcd: make autests more robust by removing need for gold file wildcard (apache#10382)
  Give a chance to send a response before receiving next request on H2 (apache#9997)
  CID 1516688: Fix uninitialized member of AcceptOptions (apache#10152)
  Fix slice head request memory issue (apache#10285)
  Fixes the TSMgmt metrics APIs for new API metrics (apache#10379)
  Minor parent.config a/an change (apache#10372)
  Allow DbgCtl tag to be set after instance construction. (apache#10375)
  Fix more build dep issues, for later PRs to work (apache#10376)
  money_trace cid 1518569: string not null terminated (apache#10373)
  Fix a couple of Coverity issues in health check plugin, around filenames (apache#10371)
  Fixes some build issues that happens with  other changes (apache#10374)
  Eliminate unreachable code covered by switch default (apache#10370)
  Add tests for disk failure (apache#10192)
  Disable copying/moving for DbgCtl. (apache#10321)
  Cmake autest (apache#10327)
  cmake: add unit tests from mgmt/rpc (apache#10366)
  Adjust CMakeLists with git worktree (apache#10298)
  Fix example plugins build (apache#10326)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake work related to CMakes scripts or issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants