Skip to content

Conversation

@torbacz
Copy link
Contributor

@torbacz torbacz commented Jan 20, 2024

Description

  • Slightly refactored WebServer class in order to be able to create unit test
  • Created basic unit tests for route matching

Motivation and Context

  • I want to introduce url parameters (like in full .net where you can put {id} in URL and it matches method parameters) and maybe serialization of body parameters into method objects.
  • I want to create benchmarks for resolving routes but for that I need a lot of unit tests :)

How Has This Been Tested?

  • unit tests

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@nfbot nfbot changed the title Refactor WebServer and add unit tests. Refactor WebServer and add unit tests Jan 20, 2024
Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Looks good all up and right direction. Thanks for putting love in the web server. There are few things I4ve seen using it recently in an advance project. So some notes for a further PR, not for this one.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Member

@Ellerbach Ellerbach left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks.

@Ellerbach
Copy link
Member

@torbacz resolve the comments if you don't have anything else to add. We can then merge this one and move to other improvments.

@torbacz
Copy link
Contributor Author

torbacz commented Jan 24, 2024

Yea, I think it's ready. And I've create a TODO list for future.
EDIT: @Ellerbach Ready to merge

@Ellerbach Ellerbach merged commit 504706b into nanoframework:main Jan 24, 2024
@Ellerbach
Copy link
Member

And I've create a TODO list for future

Shall we create a specific project for the web server? I think I can set this up in nanoFramework org. So we can track what needs to be done with some description in cards. And the one working on something just move the card. So we don't double the efforts. Thoughts?

@torbacz
Copy link
Contributor Author

torbacz commented Jan 24, 2024

@Ellerbach Sure, please create one and send me a link. I'll move list there.

@josesimoes
Copy link
Member

@Ellerbach yes please. We should be using projects a lot more than what we are today.
It's great for keeping track of ideas and tasks without cluttering repos with issues, which aren't really issues.

@Ellerbach
Copy link
Member

@torbacz and @josesimoes the project is now created, I've invited @torbacz to the project. We (José and I) can invite anyone. So let's promote it whenever there is work to do and to take. I'll add the improvements I've seen.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants