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: SUSE AI sanity test suite #20817

Merged
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
Binary file added data/aistack/open-webui-sanity-tests.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/main_micro_alp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ sub load_slem_on_pc_tests {
loadtest("publiccloud/ssh_interactive_start", run_args => $args);
loadtest("publiccloud/create_aistack_env", run_args => $args);
loadtest("publiccloud/aistack_rbac_run", run_args => $args);
loadtest("publiccloud/aistack_sanity_run", run_args => $args);
loadtest("publiccloud/ssh_interactive_end", run_args => $args);
#loadtest("publiccloud/<saintytest>", run_args => $args);
} elsif (is_container_test) {
loadtest("publiccloud/ssh_interactive_start", run_args => $args);
loadtest("publiccloud/instance_overview", run_args => $args);
Expand Down
48 changes: 48 additions & 0 deletions tests/publiccloud/aistack_sanity_run.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SUSE's openQA tests
#
# Copyright 2024 SUSE LLC
# SPDX-License-Identifier: FSFAP

# Basic aistack test

# Summary: This test performs the following actions
# - Calls AI Stack sanity tests
# Maintainer: Rhuan Queiroz <[email protected]>
#

use Mojo::Base 'publiccloud::basetest';
use strict;
use warnings;
use testapi;
use utils;
use publiccloud::utils;
use version_utils;
use transactional qw(process_reboot trup_install trup_shell trup_call);

sub test_flags {
return {fatal => 1, publiccloud_multi_module => 1};
}

sub run {
my ($self, $args) = @_;

my $instance = $self->{my_instance};
my $provider = $self->{provider};

my $test_archive = get_required_var('OPENWEBUI_SANITY_TESTS_ARCHIVE');
my $sanity_tests_url = data_url("aistack/" . $test_archive);

my $test_folder = $test_archive;
$test_folder =~ s/\.tar(\.gz)?$//;

assert_script_run("curl -O " . $sanity_tests_url);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert_script_run("curl -O " . $sanity_tests_url);
assert_script_run("curl -OLq " . $sanity_tests_url);

assert_script_run("mkdir " . $test_folder);
assert_script_run("tar -xzvf " . $test_archive . " -C " . $test_folder);
assert_script_run("python3.11 -m venv " . $test_folder . "/venv");
assert_script_run("source " . $test_folder . "/venv/bin/activate");
assert_script_run("pip3 install -r ./" . $test_folder . "/requirements.txt");
assert_script_run("cp " . $test_folder . "/env.example " . $test_folder . "/.env");
assert_script_run("pytest $test_folder/tests/");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The virtualenv is never left, perhaps a exit here would be desirable?


1;
Loading