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

3.0.6 #52

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[run]
omit =
*/tests/*

[report]
exclude_lines =
if __name__ == "__main__":
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [3.0.6] - 07-10-2024

### Changed

- Moved tests back out of the package

## [3.0.5] - 07-9-2024

### Added
Expand Down Expand Up @@ -120,6 +126,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and

- switched to `pathlib` for file path parsing

[3.0.6]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.5...3.0.6
[3.0.5]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.4...3.0.5
[3.0.4]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.3...3.0.4
[3.0.3]: https://github.com/A-Baji/discordAI-modelizer/compare/3.0.2...3.0.3
Expand Down
2 changes: 1 addition & 1 deletion discordai_modelizer/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.0.5"
__version__ = "3.0.6"
4 changes: 2 additions & 2 deletions docker-compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ services:
env_file: .env.test
volumes:
- ./discordai_modelizer:/usr/local/lib/python${PY_VER}/site-packages/discordai_modelizer
- ./discordai_modelizer/tests:/main/tests
- ./tests:/main/tests
- .coveragerc:/main/.coveragerc
command:
- sh
- -c
- |
pip install pytest pytest-cov pytest-console-scripts --root-user-action ignore
pytest --cov-report term-missing --cov=discordai --cov-config=.coveragerc tests
pytest --cov-report term-missing --cov=discordai_modelizer --cov-config=.coveragerc tests
# tail -f /dev/null
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,17 @@ def test_cli_help(script_runner):
assert "-V, --version show program's version number and exit" in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_model_list(script_runner, command):
cli = script_runner.run([command, "model", "list"])
def test_cli_model_list(script_runner):
cli = script_runner.run(["discordai_modelizer", "model", "list"])
assert cli.success
for o in expected_values.list_module_expected:
assert o in loads(cli.stdout)


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_training(script_runner, command, default_file_output):
def test_cli_training(script_runner, default_file_output):
cli = script_runner.run(
[
command,
"discordai_modelizer",
"model",
"create",
"-c",
Expand All @@ -56,90 +54,82 @@ def test_cli_training(script_runner, command, default_file_output):
assert "INFO: Starting OpenAI fine-tune job..." in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_model_list_full(script_runner, command):
cli = script_runner.run([command, "model", "list", "--full"])
def test_cli_model_list_full(script_runner):
cli = script_runner.run(["discordai_modelizer", "model", "list", "--full"])
assert cli.success
for o in expected_values.list_module_expected_full:
assert o in loads(cli.stdout)


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_delete_model(script_runner, command):
cli = script_runner.run([command, "model", "delete", "-m", "whisper-1"])
def test_cli_delete_model(script_runner):
cli = script_runner.run(
["discordai_modelizer", "model", "delete", "-m", "whisper-1"]
)
assert (
"Are you sure you want to delete this model? This action is not reversable. Y/N: "
in cli.stdout
)


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_job_list(script_runner, command):
cli = script_runner.run([command, "job", "list"])
def test_cli_job_list(script_runner):
cli = script_runner.run(["discordai_modelizer", "job", "list"])
assert cli.success
assert dumps(expected_values.list_job_expected, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_job_list_full(script_runner, command):
cli = script_runner.run([command, "job", "list", "--full"])
def test_job_list_full(script_runner):
cli = script_runner.run(["discordai_modelizer", "job", "list", "--full"])
assert cli.success
assert dumps(expected_values.list_job_expected_full, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_job_info(script_runner, command):
def test_job_info(script_runner):
cli = script_runner.run(
[command, "job", "info", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
["discordai_modelizer", "job", "info", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
)
assert cli.success
assert dumps(expected_values.job_info_expected, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_job_events(script_runner, command):
def test_job_events(script_runner):
cli = script_runner.run(
[command, "job", "events", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
["discordai_modelizer", "job", "events", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
)
assert cli.success
assert dumps(expected_values.job_events_expected, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_job_cancel(script_runner, command):
def test_job_cancel(script_runner):
cli = script_runner.run(
[command, "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
["discordai_modelizer", "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
)
assert cli.success
assert dumps(expected_values.job_cancel_expected, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_job_cancel(script_runner, command):
def test_job_cancel(script_runner):
cli = script_runner.run(
[command, "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
["discordai_modelizer", "job", "cancel", "-j", "ftjob-i2IyeV2xbLCSrYq45kTKSdwE"]
)
assert cli.success
assert dumps(expected_values.job_cancel_expected, indent=4) in cli.stdout


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_model_bad_args(script_runner, command):
def test_cli_model_bad_args(script_runner):
cli = script_runner.run(
[
command,
"discordai_modelizer",
"model",
]
)
assert not cli.success
assert "Must choose a command from `list`, `create`, or `delete`" in cli.stderr


@mark.parametrize("command", ["discordai_modelizer"])
def test_cli_job_bad_args(script_runner, command):
def test_cli_job_bad_args(script_runner):
cli = script_runner.run(
[
command,
"discordai_modelizer",
"job",
]
)
Expand Down
File renamed without changes.
File renamed without changes.
Loading