Skip to content

Commit

Permalink
Merge pull request #20817 from rqueiroz-suse/feature/suse-ai-sanity-test
Browse files Browse the repository at this point in the history
feat: SUSE AI sanity test suite
  • Loading branch information
asmorodskyi authored Dec 17, 2024
2 parents d0e3e67 + 92e72fd commit 4fa856b
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
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);
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/");
}

1;

0 comments on commit 4fa856b

Please sign in to comment.