Skip to content

Baseline tests should check for all possible extensions of not expected files #62752

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

Merged
merged 2 commits into from
Jul 17, 2025

Conversation

ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Jul 16, 2025

After #62593 renamed some template files, we could see additional files in templates structure. It could be visible only locally, in case the repository run template tests before and after the PR got in.

This revealed one issue with baseline tests: they would not fail, even if repository was creating a template with incorrect application structure, with three .csproj files instead of only one.

In the particular case of such rename, this behavior would not have been caught by the developer applying the change - for them, the additional dirs would not exist. This change does not aim at improving cleaning the repo from old assets. It is trying to fix possible other cases when we would have additional contents of extensions that we don't currently check for. Maybe there's a good reason we're not doing that. Currently, I don't see it, so I am posting this update.

Description

  • Tests: Baseline tests should check for all the types of "not expected" contents, regardless of extension. Skipping bin and obj dirs should stay.

Fixes #62746

@ilonatommy ilonatommy added this to the 10.0-preview7 milestone Jul 16, 2025
@Copilot Copilot AI review requested due to automatic review settings July 16, 2025 12:45
@ilonatommy ilonatommy added the area-blazor Includes: Blazor, Razor Components label Jul 16, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a regression in the template baseline tests by removing redundant file extension checks when determining which files to skip during template validation. The change specifically removes filtering for .csproj, .fsproj, .props, .sln, and .targets files, while preserving the exclusion of bin and obj directories.

  • Removes hardcoded file extension filters from baseline test logic
  • Maintains existing bin and obj directory exclusion patterns
  • Aligns with the stated goal of checking all "not expected" contents regardless of extension

@ilonatommy ilonatommy changed the title Fix templates - remove redundant .csproj Baseline tests should check for all possible extensions of not expected files Jul 16, 2025
@ilonatommy ilonatommy self-assigned this Jul 16, 2025
@ilonatommy ilonatommy merged commit 8bb2b20 into dotnet:main Jul 17, 2025
28 checks passed
@ilonatommy
Copy link
Member Author

ilonatommy commented Jul 18, 2025

This broke

- script: ./eng/build.cmd -ci -prepareMachine -nativeToolsOnMachine -all -noBuildRepoTasks -noBuildNative -noBuild -test

that is triggered only on PRs that change templates, so it was not triggered here. We should definitely change the condition to add triggering on change in template tests as well, @wtgodbe. I'll revert it and add that path.

edit:
This PR change falls under the paths that should trigger the job. I don't understand why it did not run, then.

edit2:
That's why:
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/file-matching-patterns?view=azure-devops
One wildcard: one dir level.
Two wildcards: all embedded dirs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blazor templates are broken
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy