Skip to content

Adding func start tests #4364

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 25 commits into from
Apr 24, 2025
Merged

Adding func start tests #4364

merged 25 commits into from
Apr 24, 2025

Conversation

aishwaryabh
Copy link
Contributor

@aishwaryabh aishwaryabh commented Apr 14, 2025

Issue describing the changes in this PR

resolves #4328

This PR is the last part of a series of PRs to set up a new testing framework for the Azure Functions CLI. This is the larger PR, which contains all the changes for the testing framework and the updated func start E2E test, if you would like to take a look at how it all fits in! I just decided to split it up since it would be easier to review and get feedback this way.

Func.E2ETests.csproj contains the func start E2E tests that are refactored to use the new test framework. The tests utilize fixtures whenever possible, with the base class being BaseFunctionAppFixture. The rest of the tests don't use a fixture and have to set up a function app with func init and func new for each test. Each test is also in its own unique working directory and using a unique port to avoid port conflicts.

CI changes:
The yaml files have been updated to publish the TestLogs (the logs are dumped into a txt file and will show up even if the tests timeout). The Build.csproj has been updated to run the new Func.E2ETests.csproj as well.

Note the func start tests in the old framework have been removed in this PR as well. I've also added a timeout of 10min so that if a test is hanging, CI will timeout and publish the logs to the TestLogs folder.

Performance Impact
After running these tests on CI, the test time for func start E2E tests have reduced by more than 50%! With the testing method, the tests would take 19 min and the newer testing method takes 7-8 min!

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@aishwaryabh aishwaryabh requested a review from a team as a code owner April 14, 2025 18:42
@aishwaryabh aishwaryabh changed the title E2E tests PART 3: Adding func start tests Adding func start tests Apr 14, 2025
Copy link
Member

@liliankasem liliankasem left a comment

Choose a reason for hiding this comment

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

Half way there; will take another look soon

@aishwaryabh
Copy link
Contributor Author

Once the PR has been reviewed, I'll add a README.md on how to add E2E tests as well

@aishwaryabh aishwaryabh force-pushed the aibhandari/func-start-tests branch 2 times, most recently from 167fb97 to 6342c08 Compare April 17, 2025 23:15
@aishwaryabh aishwaryabh force-pushed the aibhandari/func-start-tests branch from 4d5c70b to 1a00268 Compare April 21, 2025 23:17
@aishwaryabh aishwaryabh force-pushed the aibhandari/func-start-tests branch from 39bb66a to b50fbae Compare April 23, 2025 21:29
@aishwaryabh aishwaryabh force-pushed the aibhandari/func-start-tests branch from b50fbae to 0024ac3 Compare April 23, 2025 21:37
@aishwaryabh aishwaryabh merged commit b07029b into main Apr 24, 2025
11 checks passed
@aishwaryabh aishwaryabh deleted the aibhandari/func-start-tests branch April 24, 2025 21:14
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.

Update func start tests
3 participants