Skip to content

Add end to end test devoted to ctest #4186

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 84 commits into
base: main
Choose a base branch
from

Conversation

hippo91
Copy link
Contributor

@hippo91 hippo91 commented Nov 24, 2024

This changes test system

The following changes are proposed:

This PR is a proposal to add end to end test devoted to ctest part of the extension.

It adds a directory named single-root-ctest in the end-to-end-tests directory.

It also changes slightly the source directory in order:

  • to avoid early return in the refreshTests method (ctest.ts file) when in testing mode;
  • to change the return code of the ctest method (cmakeProject.ts) so that successfull test return 0 and failure returns -1.

The purpose of this change

When doing change to the ctest part of the extension, i did not feel very comfortable not being backed up by tests.
This PR tries to circumvent this.

Guillaume Peillex and others added 30 commits November 24, 2024 11:08
@hippo91
Copy link
Contributor Author

hippo91 commented Mar 22, 2025

@gcampbell-msft i integrated these tests in the PR build pipelines.

I configured C and CXX compilers for linux and windows systems. I do not have any windows os at home so i'm not able to test that. Neither can i on Mac OS. I was counting on the CI to check that.

snehara99 and others added 13 commits March 29, 2025 13:12
* updated templates

* wording updates

* updated changelog

* template updates
* Adds the getAllCMakeProjects method

* Loop over all CMake projects of the workspace to provide tasks.

Also pass the workspaceFolder to the provideTask method

* Add workspacefolder property to the CustomBuildTaskTerminal class.

This is necessary to make each task run in the correct project

* Simplify getAllCMakeProjects method.

It is a simple delegation to the eponym method of projectController

* The scope is now always a workspaceFolder

* Adds the getDefaultPresetNameForProject function

* Renames getDefaultPresetName function into getDefaultPresetNameForActiveProject

* Renames getActiveProject method into getProject method

Using workspaceFolder scope allows to retrieve the project using this folder

* Adds doc

* Get the preset for the specified workspace using the new getDefaultPresetNameForProject function

* Fix trailing space

* Adds comment

* Adds the method getProjectForFolder in the extension.

It is mostly a delegation to the eponym method of the projectController

* Update CHANGELOG.md (microsoft#3232)

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
* feat: add `cmake.ctest.testSuiteDelimiter.debugLaunchTarget`

* fix: setting name

* fix: description name

* chore: add changelog entry

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
…icrosoft#4321)

* ctest: Don't require backtrace in presence of DEF_SOURCE_LINE

* docs: add CHANGELOG entry

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
* Fix lowercase include paths on Mac

* Update CHANGELOG for version 1.21

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
… due to trailing \r, and false parsing of new "multiple definitions" error (microsoft#4341)

* Fix gnuld error parsing false positive on make errors, false negative due to trailing \r, and false parsing of new "multiple definitions" error

* Move bug fix entry in CHANGELOG to 1.21 section
* graphics

* more images

* readme updates

* whitespace

* html sanitization

* made picture clarity better

* Update README.md

* Update README.md

* rewording suggestion from Garrett

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* rewording suggestion from Garrett

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* rewording suggestion from Garrett

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* rewording suggestion from Garrett

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* reordered features

* rewording and fixing broken contributing link

* removed extra period

* made feature and banner updates

* updated alt text

* reverted wording

* removed cache editor feature image

* updated wording for presets support feature

* removed extra image

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
* Update README.md

added a brief description of the features we support

* updated readme
Co-authored-by: csigs <csigs@users.noreply.github.com>
Co-authored-by: csigs <csigs@users.noreply.github.com>
@hippo91
Copy link
Contributor Author

hippo91 commented Apr 5, 2025

@gcampbell-msft i tried to debug the failing CI tests but was unable to understand what was failing in the build step.

I suppose this is the build of the C++ test project but cannot confirm.
For now i try to run the CI locally using act. If you have any idea or hint about how i can debug the CI i'll be happy to try them.

@gcampbell-msft
Copy link
Collaborator

@hippo91 Update, it looks like the builds are failing tests due to an unexpected temp folder, possibly due to differences in OS's. Could you investigate?

OR, please let us know if you'd like help with this PR, and we can aim to help out on this PR for milestone 1.21.

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 12, 2025

@gcampbell-msft i am trying to investigate but i do not know how i can have access to build output or log. Have you got any idea?
Another approach that i'am trying is to run the CI locally thanks to act. Maybe is there another possibility?

@gcampbell-msft
Copy link
Collaborator

@hippo91 Are you not able to view the build log if you click on the github links?

Our CI pipelines run publicly in github. Here is a link to the Windows one, for example, https://github.com/microsoft/vscode-cmake-tools/actions/runs/14145701868/job/40095177801?pr=4186

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 16, 2025

@gcampbell-msft i am able to see the build log but for linux the only interesting thing is Warning: ls] 2025-04-07T11:17:46.863Z [warning] [proc] The command: /home/runner/work/_temp/-1604695791/cmake-3.18.3-Linux-x86_64/bin/cmake --build /home/runner/work/vscode-cmake-tools/vscode-cmake-tools/test/end-to-end-tests/single-root-ctest/project-folder/build -- exited with code: 1 but i have no access to the inner log of this command.

It seems like the cmake command does not receive the correct config preset.
It is really weird because on my laptop (running debian) using act, the CI is successful.

@gcampbell-msft
Copy link
Collaborator

gcampbell-msft commented Apr 16, 2025

@hippo91 I'm also interested in the failure for the Windows build. However, I also can't see any more information. I'll do my best to make time to investigate this sometime in the next week or so. If I don't get to it, we do hope to take this in our 1.21 milestone, which we hope to release in the next month or two. Thanks for your patience.

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 16, 2025

@gcampbell-msft the problem with windows is due to the fact i dumbly hardcoded path to /tmp which of course does not exist on windows. I should be able to fix this. However the only way for me to check windows execution is through the CI.

And for Linux in the CI for now i have no clue.

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 17, 2025

@gcampbell-msft i think i fixed the windows problem. Can you relaunch the CI please?

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 17, 2025

@gcampbell-msft surprisingly linux ci seems to be ok.

I removed an unused CMAKE variable for windows. It was generating what could be an error.

@hippo91
Copy link
Contributor Author

hippo91 commented Apr 20, 2025

@gcampbell-msft the linux part of the CI is ok but i'm struggling with the windows one (the macos one is failing in an unrelated test). If you could have a look it would be nice. Please tell me if i can do anything to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants