Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
06460406
Commit
06460406
authored
Nov 14, 2022
by
Vladimir Repin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propagate test error and try it without localhost
parent
3ffc1c6c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
19 deletions
+22
-19
launch.py
launch.py
+4
-3
extras_test.py
test/advanced_features/extras_test.py
+1
-1
txt2img_test.py
test/advanced_features/txt2img_test.py
+1
-1
img2img_test.py
test/basic_features/img2img_test.py
+1
-1
txt2img_test.py
test/basic_features/txt2img_test.py
+1
-1
utils_test.py
test/basic_features/utils_test.py
+11
-11
server_poll.py
test/server_poll.py
+3
-1
No files found.
launch.py
View file @
06460406
...
...
@@ -234,8 +234,8 @@ def prepare_enviroment():
exit
(
0
)
if
run_tests
:
tests
(
test_dir
)
exit
(
0
)
exitcode
=
tests
(
test_dir
)
exit
(
exitcode
)
def
tests
(
test_dir
):
...
...
@@ -251,10 +251,11 @@ def tests(test_dir):
proc
=
subprocess
.
Popen
([
sys
.
executable
,
*
sys
.
argv
],
stdout
=
stdout
,
stderr
=
stderr
)
import
test.server_poll
test
.
server_poll
.
run_tests
(
proc
,
test_dir
)
exitcode
=
test
.
server_poll
.
run_tests
(
proc
,
test_dir
)
print
(
f
"Stopping Web UI process with id {proc.pid}"
)
proc
.
kill
()
return
exitcode
def
start
():
...
...
test/advanced_features/extras_test.py
View file @
06460406
...
...
@@ -3,7 +3,7 @@ import unittest
class
TestExtrasWorking
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
url_img2img
=
"http://
localhost
:7860/sdapi/v1/extra-single-image"
self
.
url_img2img
=
"http://
127.0.0.1
:7860/sdapi/v1/extra-single-image"
self
.
simple_extras
=
{
"resize_mode"
:
0
,
"show_extras_results"
:
True
,
...
...
test/advanced_features/txt2img_test.py
View file @
06460406
...
...
@@ -4,7 +4,7 @@ import requests
class
TestTxt2ImgWorking
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
url_txt2img
=
"http://
localhost
:7860/sdapi/v1/txt2img"
self
.
url_txt2img
=
"http://
127.0.0.1
:7860/sdapi/v1/txt2img"
self
.
simple_txt2img
=
{
"enable_hr"
:
False
,
"denoising_strength"
:
0
,
...
...
test/basic_features/img2img_test.py
View file @
06460406
...
...
@@ -6,7 +6,7 @@ from PIL import Image
class
TestImg2ImgWorking
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
url_img2img
=
"http://
localhost
:7860/sdapi/v1/img2img"
self
.
url_img2img
=
"http://
127.0.0.1
:7860/sdapi/v1/img2img"
self
.
simple_img2img
=
{
"init_images"
:
[
encode_pil_to_base64
(
Image
.
open
(
r"test/test_files/img2img_basic.png"
))],
"resize_mode"
:
0
,
...
...
test/basic_features/txt2img_test.py
View file @
06460406
...
...
@@ -4,7 +4,7 @@ import requests
class
TestTxt2ImgWorking
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
url_txt2img
=
"http://
localhost
:7860/sdapi/v1/txt2img"
self
.
url_txt2img
=
"http://
127.0.0.1
:7860/sdapi/v1/txt2img"
self
.
simple_txt2img
=
{
"enable_hr"
:
False
,
"denoising_strength"
:
0
,
...
...
test/basic_features/utils_test.py
View file @
06460406
...
...
@@ -3,17 +3,17 @@ import requests
class
UtilsTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
url_options
=
"http://
localhost
:7860/sdapi/v1/options"
self
.
url_cmd_flags
=
"http://
localhost
:7860/sdapi/v1/cmd-flags"
self
.
url_samplers
=
"http://
localhost
:7860/sdapi/v1/samplers"
self
.
url_upscalers
=
"http://
localhost
:7860/sdapi/v1/upscalers"
self
.
url_sd_models
=
"http://
localhost
:7860/sdapi/v1/sd-models"
self
.
url_hypernetworks
=
"http://
localhost
:7860/sdapi/v1/hypernetworks"
self
.
url_face_restorers
=
"http://
localhost
:7860/sdapi/v1/face-restorers"
self
.
url_realesrgan_models
=
"http://
localhost
:7860/sdapi/v1/realesrgan-models"
self
.
url_prompt_styles
=
"http://
localhost
:7860/sdapi/v1/prompt-styles"
self
.
url_artist_categories
=
"http://
localhost
:7860/sdapi/v1/artist-categories"
self
.
url_artists
=
"http://
localhost
:7860/sdapi/v1/artists"
self
.
url_options
=
"http://
127.0.0.1
:7860/sdapi/v1/options"
self
.
url_cmd_flags
=
"http://
127.0.0.1
:7860/sdapi/v1/cmd-flags"
self
.
url_samplers
=
"http://
127.0.0.1
:7860/sdapi/v1/samplers"
self
.
url_upscalers
=
"http://
127.0.0.1
:7860/sdapi/v1/upscalers"
self
.
url_sd_models
=
"http://
127.0.0.1
:7860/sdapi/v1/sd-models"
self
.
url_hypernetworks
=
"http://
127.0.0.1
:7860/sdapi/v1/hypernetworks"
self
.
url_face_restorers
=
"http://
127.0.0.1
:7860/sdapi/v1/face-restorers"
self
.
url_realesrgan_models
=
"http://
127.0.0.1
:7860/sdapi/v1/realesrgan-models"
self
.
url_prompt_styles
=
"http://
127.0.0.1
:7860/sdapi/v1/prompt-styles"
self
.
url_artist_categories
=
"http://
127.0.0.1
:7860/sdapi/v1/artist-categories"
self
.
url_artists
=
"http://
127.0.0.1
:7860/sdapi/v1/artists"
def
test_options_get
(
self
):
self
.
assertEqual
(
requests
.
get
(
self
.
url_options
)
.
status_code
,
200
)
...
...
test/server_poll.py
View file @
06460406
...
...
@@ -8,7 +8,7 @@ def run_tests(proc, test_dir):
start_time
=
time
.
time
()
while
time
.
time
()
-
start_time
<
timeout_threshold
:
try
:
requests
.
head
(
"http://
localhost
:7860/"
)
requests
.
head
(
"http://
127.0.0.1
:7860/"
)
break
except
requests
.
exceptions
.
ConnectionError
:
if
proc
.
poll
()
is
not
None
:
...
...
@@ -18,5 +18,7 @@ def run_tests(proc, test_dir):
test_dir
=
""
suite
=
unittest
.
TestLoader
()
.
discover
(
test_dir
,
pattern
=
"*_test.py"
,
top_level_dir
=
"test"
)
result
=
unittest
.
TextTestRunner
(
verbosity
=
2
)
.
run
(
suite
)
return
len
(
result
.
failures
)
else
:
print
(
"Launch unsuccessful"
)
return
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment