FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ews-coordinator
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gilligan Lab for Epidemiology and Modelling
Wheat rusts
ews-coordinator
Commits
9f3c984e
Commit
9f3c984e
authored
2 years ago
by
L. Bower
Browse files
Options
Downloads
Patches
Plain Diff
making full integration tests use the same test suite as half-fat ones (work ongoing)
parent
1b49992d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/integration/test_suites/__init__.py
+0
-0
0 additions, 0 deletions
tests/integration/test_suites/__init__.py
tests/integration/test_suites/depo_test_suite.py
+90
-0
90 additions, 0 deletions
tests/integration/test_suites/depo_test_suite.py
with
90 additions
and
0 deletions
tests/integration/test_suites/__init__.py
0 → 100644
+
0
−
0
View file @
9f3c984e
This diff is collapsed.
Click to expand it.
tests/integration/test_suites/depo_test_suite.py
0 → 100644
+
90
−
0
View file @
9f3c984e
import
abc
import
glob
import
os
import
unittest
from
integration.partial.integration_test_utils
import
IntegrationTestUtils
class
BaseDepoTestSuite
:
"""
to prevent the full integrations tests that extend the partial integrations tests running the tests twice,
the test suite is nested in a base class, to keep it at a seperate package-level
"""
class
DepoTestSuite
(
unittest
.
TestCase
):
TEST_OUT_PATH
:
str
=
None
TEST_START_DATE
:
str
=
'
20221001
'
TEST_JOB_DIR
:
str
=
"
DEPOSITION_
"
+
TEST_START_DATE
"""
these fields need to be overridden in the tests that use this test suite, override the
'
set_expected_values
'
function below
"""
EA_CSV_COUNT
:
int
=
None
ETH_CSV_COUNT
:
int
=
None
EA_PNG_COUNT
:
int
=
None
ETH_PNG_COUNT
:
int
=
None
@abc.abstractmethod
def
set_expected_values
(
self
):
return
def
test_standard_run_input_status_success
(
self
):
status_file_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
STATUS_SUCCESS
"
)
success_file_exists
:
bool
=
os
.
path
.
isfile
(
status_file_path
)
self
.
assertTrue
(
success_file_exists
)
def
test_standard_run_input_all_regions_ran
(
self
):
"""
working on the assumption that if there are images for each region, it must have run through
(at least past the region iteration)
"""
east_africa_image_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
eastafrica
"
,
"
images
"
,
"
Weekly
"
,
"
deposition_eastafrica_leaf_rust_total_*_map.png
"
)
ethiopia_image_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
ethiopia
"
,
"
images
"
,
"
Weekly
"
,
"
deposition_ethiopia_leaf_rust_total_*_map.png
"
)
ea_file_exists
:
bool
=
len
(
glob
.
glob
(
east_africa_image_path
))
>
0
eth_file_exists
:
bool
=
len
(
glob
.
glob
(
ethiopia_image_path
))
>
0
self
.
assertTrue
(
ea_file_exists
)
self
.
assertTrue
(
eth_file_exists
)
def
test_standard_run_all_input_csvs_produced
(
self
):
east_africa_csv_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
eastafrica
"
,
"
input_csvs
"
,
"
*.csv
"
)
ethiopia_csv_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
ethiopia
"
,
"
input_csvs
"
,
"
*.csv
"
)
ea_csv_count
:
int
=
IntegrationTestUtils
.
count_files_in_wildcard
(
east_africa_csv_path
)
eth_csv_count
:
int
=
IntegrationTestUtils
.
count_files_in_wildcard
(
ethiopia_csv_path
)
self
.
assertEqual
(
self
.
EA_CSV_COUNT
,
ea_csv_count
)
self
.
assertEqual
(
self
.
ETH_CSV_COUNT
,
eth_csv_count
)
def
test_standard_run_all_images_produced
(
self
):
east_africa_image_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
eastafrica
"
,
"
images
"
,
"
Weekly
"
,
"
*.png
"
)
ethiopia_image_path
=
os
.
path
.
join
(
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_OUT_PATH
,
BaseDepoTestSuite
.
DepoTestSuite
.
TEST_JOB_DIR
,
"
plotting
"
,
"
ethiopia
"
,
"
images
"
,
"
Weekly
"
,
"
*.png
"
)
ea_png_count
:
int
=
IntegrationTestUtils
.
count_files_in_wildcard
(
east_africa_image_path
)
eth_png_count
:
int
=
IntegrationTestUtils
.
count_files_in_wildcard
(
ethiopia_image_path
)
self
.
assertEqual
(
self
.
EA_PNG_COUNT
,
ea_png_count
)
self
.
assertEqual
(
self
.
ETH_PNG_COUNT
,
eth_png_count
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment