[SERVER-84428] resmoke no longer errors if given a nonexistent JavaScript file at the command line Created: 27/Dec/23  Updated: 02/Jan/24

Status: Needs Scheduling
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: [DO NOT ASSIGN] Backlog - DevProd Correctness
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
is caused by SERVER-68699 Write a test that checks that resmoke... Closed
Assigned Teams:
Correctness
Operating System: ALL
Participants:

 Description   

The changes from c019228 as part of SERVER-68699 cause resmoke to no longer error when given a nonexistent JavaScript file at the command line. This is confusing behavior to engineers who mistyped the path to a JavaScript file (e.g. a JavaScript file generated by the fuzzer).


Steps to reproduce

$ python buildscripts/resmoke.py run --suite=core does_not_exist.js
...
[executor] 15:02:58.060Z Skipping js_test, no tests to run
[resmoke] 15:02:58.060Z ================================================================================
[resmoke] 15:02:58.060Z Summary of core suite: No tests ran.
Suite did not run any tests.
[resmoke] 15:02:58.060Z Exiting with code: 0

The prior and expected output would instead be the following:

Traceback (most recent call last):
  File "/home/ubuntu/mongo/buildscripts/resmoke.py", line 20, in <module>
    entrypoint()
  File "/home/ubuntu/mongo/buildscripts/resmoke.py", line 16, in entrypoint
    cli.main(sys.argv)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/cli.py", line 32, in main
    subcommand.execute()
  File "/home/ubuntu/mongo/buildscripts/resmokelib/run/__init__.py", line 132, in execute
    self.run_tests()
  File "/home/ubuntu/mongo/buildscripts/resmokelib/run/__init__.py", line 244, in run_tests
    suites = self._get_suites()
  File "/home/ubuntu/mongo/buildscripts/resmokelib/run/__init__.py", line 616, in _get_suites
    return suitesconfig.get_suites(config.SUITE_FILES, config.TEST_FILES)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/suitesconfig.py", line 115, in get_suites
    for test in override_suite.tests:
  File "/home/ubuntu/mongo/buildscripts/resmokelib/testing/suite.py", line 103, in tests
    self._tests, self._excluded = self._get_tests_for_kind(self.test_kind)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/testing/suite.py", line 125, in _get_tests_for_kind
    return _selector.filter_tests(test_kind, selector_config)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/selector.py", line 801, in filter_tests
    return selector.select(selector_config)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/selector.py", line 509, in select
    return _Selector.select(self, selector_config)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/selector.py", line 460, in select
    test_list = _TestList(self._test_file_explorer, roots, self._tests_are_files)
  File "/home/ubuntu/mongo/buildscripts/resmokelib/selector.py", line 167, in __init__
    self._roots = self._expand_files(roots) if tests_are_files else roots
  File "/home/ubuntu/mongo/buildscripts/resmokelib/selector.py", line 177, in _expand_files
    raise ValueError("Unrecognized test file: {}".format(test))
ValueError: Unrecognized test file: does_not_exist.js



 Comments   
Comment by Max Hirschhorn [ 27/Dec/23 ]

The changes from c019228 as part of SERVER-68699 also removed the *[aA]uth*.js related glob patterns. While these glob patterns may not currently match any files in certain directories, it is a well-established convention for any files containing the word "auth" to be excluded from auth passthroughs. I would advocate for these glob patterns to be restored in case a matching file is added/moved into these test suites in the future.

Generated at Thu Feb 08 06:55:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.