Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Make tests easier to run#4620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cwalther wants to merge5 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromindel-ag:fixtests
Open

Conversation

@cwalther
Copy link

This changes the developer experience (but not the user experience)

The following changes are proposed:

  • Lift cmake_minimum_required of test cases to 3.5.0
  • Skip server mode tests on CMake >= 3.20
  • Fix sysroot access test
  • Clarify that fakebin must be built before running tests

(More details in the individual commit messages.)

The purpose of this change

Make it easier for a new developer of CMake Tools to run tests.

Other Notes/Information

I was working on a new feature for CMake Tools and, being new to the project, was having some trouble running the tests. After some investigation, it all came down to two hurdles:

  1. It is not obvious that the tests are intended to be run with a specific old version of CMake (3.18).
  2. It is not obvious that before running tests one needs to build the executables in test/fakebin/ using the test/fakeOutputGenerator/ project.

To fix 1., instead of just writing instructions to install CMake 3.18, I decided to make the tests work with the current version 4.2, because thefeature I am working on requires CMake 4.3 (not released yet) and I will want to test with that too. The changes required for that turned out to be relatively minor, and are contained in the first three of the attached commits.

To fix 2., I made the tests that without fakebin executables would fail in obscure ways, instead fail with a clear message telling the user how to build the missing executables. This is the last commit.

Together, these changes allow me to successfully run all tests (yarn smokeTests,unitTests,integrationTests,endToEndTestsSuccessfulBuild,endToEndTestsSingleRoot,endToEndTestsMultiRoot,backendTests) with both CMake 4.2.0 and 3.18.6 on my Ubuntu 20.04 system.

Would these changes be welcome in the project? Or would you prefer other ways to mitigate these hurdles?

Since these are not user-visible changes, I did not add an entry to CHANGELOG.md. Should I?

Otherwise tests that have `cmake_minimum_required(VERSION 3.0.0)` or similarfail when run with the current CMake 4.2.0, whose lowest supported versionis 3.5.0.I have not individually checked whether the test cases rely on any policiesthat changed between 3.0.0 and 3.5.0, but the tests still pass.
@cwalther
Copy link
Author

@microsoft-github-policy-service agree company="Indel AG"

Server Mode was removed in favor of the File API in CMake 3.20, so skip therespective tests when it is not supported. Whether server mode is supportedwas tracked already, but only with a lower version bound. Availability ofserver mode is explicitly named in the `-E capabilities` response, soadditionally take that into account, effectively adding an upper bound.
Skip configure-time compiler checks when passing a fake sysroot to thecompiler, they would fail because it is unable to link an executable thatway.I am not sure under what circumstances this has ever worked.
Make the tests that rely on executables in test/fakebin/ check whether theyexist, and if not give a helpful error message, instead of failing inunclear ways when they find things in the system $PATH instead.Add a command `yarn pretest-buildfakebin` that documents how to build theseexecutables, which was otherwise only documented in.github/workflows/ci-main*.yml and .vscode/settings.json.
@cwalther
Copy link
Author

I had forgotten to runFormat Document again on modified TypeScript files. Fixed in this force push.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@cwalther

[8]ページ先頭

©2009-2025 Movatter.jp