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: Add new test cases for LoadConfigs #447

Merged
merged 2 commits into from
Jun 1, 2023
Merged

feat: Add new test cases for LoadConfigs #447

merged 2 commits into from
Jun 1, 2023

Conversation

Aisuko
Copy link
Collaborator

@Aisuko Aisuko commented May 31, 2023

Description

This PR fixes #262

  • settings.json can help the contributor to more easily debug the project by using VSCode debug features but it should not include any default values.
  • Replacing the deprecated args of ginkgo--flakeAttempts to --flake-attempts
  • Replacing the ioutil.ReadDir(path) to os.ReadDir(path) and adding a test case for it. ioutil.ReadDir was deprecated in go v.1.19, more detail. here: https://pkg.go.dev/io/ioutil#example-ReadDir

Notes for Reviewers

All the test cases are passed at local

Ran 20 of 20 Specs in 358.258 seconds
SUCCESS! -- 20 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
Running Suite: Gallery test suite - /workspaces/LocalAI/pkg/gallery
===================================================================
Random Seed: 1685511683

Will run 4 of 4 specs
------------------------------
Model test Downloading applies model correctly
/workspaces/LocalAI/pkg/gallery/models_test.go:15
{"level":"debug","time":"2023-05-31T05:47:25Z","message":"Checking \"cerebras\" exists and matches SHA"}
{"level":"debug","time":"2023-05-31T05:47:25Z","message":"Downloading \"https://huggingface.co/concedo/cerebras-111M-ggml/resolve/main/cerebras-111m-q4_2.bin\""}
{"level":"debug","time":"2023-05-31T05:47:25Z","message":"Download and verifying \"cerebras\""}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"File \"cerebras\" downloaded and verified"}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Prompt template \"cerebras-completion\" written"}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Prompt template \"cerebras-chat\" written"}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Written config file /tmp/test4073225701/cerebras.yaml"}
• [4.033 seconds]
------------------------------
Model test Downloading renames model correctly
/workspaces/LocalAI/pkg/gallery/models_test.go:41
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Checking \"cerebras\" exists and matches SHA"}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Downloading \"https://huggingface.co/concedo/cerebras-111M-ggml/resolve/main/cerebras-111m-q4_2.bin\""}
{"level":"debug","time":"2023-05-31T05:47:29Z","message":"Download and verifying \"cerebras\""}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"File \"cerebras\" downloaded and verified"}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Prompt template \"cerebras-completion\" written"}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Prompt template \"cerebras-chat\" written"}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Written config file /tmp/test397832532/foo.yaml"}
• [3.061 seconds]
------------------------------
Model test Downloading overrides parameters
/workspaces/LocalAI/pkg/gallery/models_test.go:57
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Config overrides map[backend:foo]"}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Checking \"cerebras\" exists and matches SHA"}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Downloading \"https://huggingface.co/concedo/cerebras-111M-ggml/resolve/main/cerebras-111m-q4_2.bin\""}
{"level":"debug","time":"2023-05-31T05:47:32Z","message":"Download and verifying \"cerebras\""}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"File \"cerebras\" downloaded and verified"}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Prompt template \"cerebras-completion\" written"}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Prompt template \"cerebras-chat\" written"}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Written config file /tmp/test888167950/foo.yaml"}
• [3.073 seconds]
------------------------------
Model test Downloading catches path traversals
/workspaces/LocalAI/pkg/gallery/models_test.go:83
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Checking \"cerebras\" exists and matches SHA"}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Downloading \"https://huggingface.co/concedo/cerebras-111M-ggml/resolve/main/cerebras-111m-q4_2.bin\""}
{"level":"debug","time":"2023-05-31T05:47:35Z","message":"Download and verifying \"cerebras\""}
{"level":"debug","time":"2023-05-31T05:47:38Z","message":"File \"cerebras\" downloaded and verified"}
{"level":"debug","time":"2023-05-31T05:47:38Z","message":"Prompt template \"cerebras-completion\" written"}
{"level":"debug","time":"2023-05-31T05:47:38Z","message":"Prompt template \"cerebras-chat\" written"}
• [3.076 seconds]
------------------------------

Ran 4 of 4 Specs in 13.243 seconds
SUCCESS! -- 4 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS

Ginkgo ran 2 suites in 6m14.4758893s
Test Suite Passed

Signed commits

  • Yes, I signed my commits.

.vscode/settings.json Outdated Show resolved Hide resolved
Signed-off-by: Aisuko <urakiny@gmail.com>
@Aisuko Aisuko requested a review from mudler May 31, 2023 10:01
Copy link
Owner

@mudler mudler 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!

@mudler mudler merged commit c8a4a4f into master Jun 1, 2023
@mudler mudler deleted the feat/debugenv branch June 1, 2023 14:20
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.

feat: add more test cases for the project and community maintenance
2 participants