Skip to content
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

feat: support to set the prefix of mock server #402

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

LinuxSuRen
Copy link
Owner

What type of PR is this?

What this PR does / why we need it:
Allowing user to set the prefix can meet more use cases.

Which issue(s) this PR fixes:

Fixes #

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@LinuxSuRen LinuxSuRen added the enhancement New feature or request label Apr 25, 2024
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% 88.89%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (e997437) 12620 5803 45.98%
Head commit (8dad246) 12622 (+2) 5805 (+2) 45.99% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#402) 9 8 88.89%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy will stop sending the deprecated coverage status from June 5th, 2024. Learn more

Copy link

There are 20 test cases, failed count 0:

See all test records
Name Average Max Min Count Error
createSuite 3.356644ms 3.356644ms 3.356644ms 1 0
2.614073ms 3.968159ms 1.400777ms 9 0
list-testcases-not-found 2.27968ms 2.27968ms 2.27968ms 1 0
GenerateCode 2.16509ms 2.16509ms 2.16509ms 1 0
query-funcs 1.821625ms 1.821625ms 1.821625ms 1 0
listConverters 1.729564ms 1.729564ms 1.729564ms 1 0
get-testcase-not-found 1.621028ms 1.621028ms 1.621028ms 1 0
ListTestCase 1.618157ms 1.618157ms 1.618157ms 1 0
ConvertTestSuite 1.461141ms 1.461141ms 1.461141ms 1 0
version 1.41779ms 1.41779ms 1.41779ms 1 0
GetSuggestedAPIs-no-testsuite-found 1.299787ms 1.299787ms 1.299787ms 1 0
DeleteTestSuite 1.227572ms 1.227572ms 1.227572ms 1 0
suite 1.13351ms 1.13351ms 1.13351ms 1 0
get-popular-headers 1.126381ms 1.126381ms 1.126381ms 1 0
suites 1.103369ms 1.103369ms 1.103369ms 1 0
GetSecrets 919.072µs 919.072µs 919.072µs 1 0
list-code-generators 810.159µs 810.159µs 810.159µs 1 0
list-stores 724.186µs 724.186µs 724.186µs 1 0
UpdateTestSuite 703.499µs 703.499µs 703.499µs 1 0
DeleteTestSuiteNotFound 630.683µs 630.683µs 630.683µs 1 0

Reported by api-testing.

Copy link

github-actions bot commented Apr 25, 2024

There are 23 test cases, failed count 0:

See all test records
Name Average Max Min Count Error
createSuite 3.021938291s 3.021938291s 3.021938291s 31 0
downloadTool 4.625936ms 4.625936ms 4.625936ms 31 0
downloadExtGit 4.097686ms 4.097686ms 4.097686ms 31 0
runGRPCTestCase 3.664113ms 3.664113ms 3.664113ms 5 0
updateTestCase 2.819663ms 2.819663ms 2.819663ms 5 0
updateSuite 2.782064ms 2.782064ms 2.782064ms 5 0
createGRPCTestCase 2.736862ms 2.736862ms 2.736862ms 31 0
createGRPCSuite 2.729082ms 2.729082ms 2.729082ms 31 0
getTestCase 2.591773ms 2.591773ms 2.591773ms 31 0
deleteTestCase 2.541106ms 2.541106ms 2.541106ms 5 0
CreateStore 2.317399ms 2.317399ms 2.317399ms 5 0
createTestCase 2.301026ms 2.301026ms 2.301026ms 31 0
getSuite 2.146171ms 2.146171ms 2.146171ms 5 0
getGRPCTestCase 2.020295ms 2.020295ms 2.020295ms 31 0
GetSuggestedAPIs 1.582175ms 1.582175ms 1.582175ms 5 0
popularHeaders 1.280662ms 1.280662ms 1.280662ms 5 0
oauth 908.778µs 908.778µs 908.778µs 5 0
functionsQuery 727.714µs 727.714µs 727.714µs 31 0
debugCmdLine 711.062µs 711.062µs 711.062µs 5 0
listCodeGenerator 627.188µs 627.188µs 627.188µs 5 0
findUnknownFunction 626.726µs 626.726µs 626.726µs 31 0
favicon 619.792µs 619.792µs 619.792µs 5 0
version 555.631µs 555.631µs 555.631µs 5 0

e2e-testing

@LinuxSuRen
Copy link
Owner Author

hi @YukiCoco, please feel free to help to review this PR. Thanks.

@LinuxSuRen LinuxSuRen merged commit ffac34f into master Apr 28, 2024
15 checks passed
@LinuxSuRen LinuxSuRen deleted the feat/mock-prefix branch April 28, 2024 00:30
@YukiCoco
Copy link
Contributor

hi @YukiCoco, please feel free to help to review this PR. Thanks.

I just saw the update that the PR has been successfully merged and closed—thanks for taking care of it! I must apologize for missing your initial message in my crowded email inbox. I'm truly sorry for not being able to provide my input on time. I’d be grateful for any opportunity to contribute to future projects. Please don't hesitate to reach out.

@LinuxSuRen
Copy link
Owner Author

No worry. Please let me know if you find any things that need to be improved in this PR.

By the way, there are many things we can do on the mock server part. For example:

  • Random delay response support
  • Built-in auth support
  • Multiple levels API paths support.
    • Currently, it can serve like /v1/projects, but it not support /v1/projects/{demo}/users/{someone}
  • Control the mock server on the web page

@YukiCoco
Copy link
Contributor

No worry. Please let me know if you find any things that need to be improved in this PR.

By the way, there are many things we can do on the mock server part. For example:

  • Random delay response support

  • Built-in auth support

  • Multiple levels API paths support.

    • Currently, it can serve like /v1/projects, but it not support /v1/projects/{demo}/users/{someone}
  • Control the mock server on the web page

I have tested this code and it works well. I will try to support more mock functions.

LinuxSuRen added a commit that referenced this pull request Apr 30, 2024
Co-authored-by: rick <linuxsuren@users.noreply.github.com>
LinuxSuRen added a commit that referenced this pull request Apr 30, 2024
Co-authored-by: rick <linuxsuren@users.noreply.github.com>
LinuxSuRen added a commit that referenced this pull request Apr 30, 2024
Co-authored-by: rick <linuxsuren@users.noreply.github.com>
LinuxSuRen added a commit that referenced this pull request Apr 30, 2024
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants