[SERVER-40241] Have resmoke.py log an invocation for local usage Created: 20/Mar/19  Updated: 29/Oct/23  Resolved: 28/Mar/19

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 4.1.10

Type: New Feature Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Max Hirschhorn
Resolution: Fixed Votes: 1
Labels: tig-resmoke
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-40801 resmoke.py logs invalid --excludeWith... Closed
related to SERVER-40245 Use attach.artifacts to link to GitHu... Closed
Backwards Compatibility: Fully Compatible
Sprint: STM 2019-04-08
Participants:
Story Points: 3

 Description   

The changes from SERVER-28785 made it so resmoke.py writes its own command line arguments to stdout. This enables Server engineers to avoid doing mental bash evaluation to determine what command line arguments the "run tests" will synthesize and pass to resmoke.py. The command line arguments for this aggregation task include a large number of details and metadata that are specific to how we run tests in Evergreen.

[2019/03/11 20:41:06.323] [resmoke] 2019-03-11T20:41:06.322+0000 resmoke.py invocation: buildscripts/evergreen_run_tests.py --suites=aggregation --storageEngine=wiredTiger --jobs=4 --shuffle --continueOnFailure --storageEngineCacheSizeGB=1 --tagFile=etc/test_retrial.yml --log=buildlogger --staggerJobs=on --buildId=mongodb_mongo_master_enterprise_rhel_62_64_bit_6f083bd87264e9d9c3d637fae62103c36a65316a_19_03_11_19_56_34 --distroId=rhel62-small --executionNumber=0 --projectName=mongodb-mongo-master --gitRevision=6f083bd87264e9d9c3d637fae62103c36a65316a --revisionOrderId=24937 --taskId=mongodb_mongo_master_enterprise_rhel_62_64_bit_aggregation_6f083bd87264e9d9c3d637fae62103c36a65316a_19_03_11_19_56_34 --taskName=aggregation --variantName=enterprise-rhel-62-64-bit --versionId=mongodb_mongo_master_6f083bd87264e9d9c3d637fae62103c36a65316a --archiveFile=archive.json --reportFile=report.json --perfReportFile=perf.json

A more compact form for an engineer to run would look like:

buildscripts/resmoke.py --suites=aggregation --storageEngine=wiredTiger --jobs=4 --shuffle --continueOnFailure --storageEngineCacheSizeGB=1

The changes from this ticket should add a new log message after this line containing the simplified resmoke.py invocation.

self._resmoke_logger.info("verbatim resmoke.py invocation: %s", " ".join(sys.argv))
if config.EVERGREEN_TASK_ID:
    args = ...
    self._resmoke_logger.info("resmoke.py invocation for local usage: %s", " ".join(args))

It must therefore do the following:

  • Always log the program name as buildscripts/resmoke.py even though in Evergreen we run the wrapper script buildscripts/evergreen_run_tests.py.
  • Always log the non-generated version of the test suite name. The buildscripts/evergreen_generate_resmoke_tasks.py script generates new resmoke.py YAML suite files in order to be able to dynamically split the test suite into multiple Evergreen task which may run concurrently. Handling this behavior can be achieved by propagating self.config_options.suite as a new --originSuite command line option to resmoke.py through the _generate_resmoke_args() function.
    • The sub-suite definitions are uploaded to Evergreen in the *_gen task as "Generated Task Config" but we don't really want engineers to have to worry about using them.
  • Always remove the command line options not seen in the compact form above. The implementation should explicitly list the command line options to remove so that new ones still appear by default. It might be possible to be a little clever about trying to remove all the options from the evergreen_options group so that new ones added to that section never appear.


 Comments   
Comment by Githook User [ 28/Mar/19 ]

Author:

{'name': 'Max Hirschhorn', 'username': 'visemet', 'email': 'max.hirschhorn@mongodb.com'}

Message: SERVER-40241 Log resmoke.py invocation for local usage.
Branch: master
https://github.com/mongodb/mongo/commit/5acc5f3ef49a6dbbd4397fc61bc948e24fd9e780

Generated at Thu Feb 08 04:54:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.