-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adding support for pytest-xdist (#628)
* support for xdist * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * skip reuse server test in Windows * checkpoint * install decord from fork * fix * minor fix * checkpoint * ci: add support for macos * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * test eva decord * adds eva-decord * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint * checkpoint --------- Co-authored-by: Suryatej Reddy Vyalla <suryatej16102@iiitd.ac.in> Co-authored-by: Gaurav <gaurav21776@gmail.com>
- Loading branch information
1 parent
a4f3968
commit 612b590
Showing
9 changed files
with
175 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# coding=utf-8 | ||
# Copyright 2018-2022 EVA | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import os | ||
import unittest | ||
from pathlib import Path | ||
|
||
from eva.catalog.sql_config import SQLConfig | ||
from eva.configuration.configuration_manager import ConfigurationManager | ||
from eva.utils.generic_utils import prefix_worker_id_to_path | ||
|
||
|
||
class XdistTests(unittest.TestCase): | ||
def test_prefix_worker_id_to_uri_in_sql_config(self): | ||
os.environ["PYTEST_XDIST_WORKER"] = "gw1" | ||
sql_config = SQLConfig() | ||
self.assertTrue("gw1" in sql_config.worker_uri) | ||
|
||
os.environ["PYTEST_XDIST_WORKER"] = "" | ||
sql_config = SQLConfig() | ||
self.assertFalse("gw1" in sql_config.worker_uri) | ||
|
||
def test_suffix_pytest_xdist_worker_id_to_dir(self): | ||
os.environ["PYTEST_XDIST_WORKER"] = "gw1" | ||
foo_path = Path("foo") | ||
configuration_manager = ConfigurationManager() | ||
updated_path = configuration_manager.suffix_pytest_xdist_worker_id_to_dir( | ||
foo_path | ||
) | ||
self.assertTrue("gw1" in str(updated_path)) | ||
|
||
os.environ["PYTEST_XDIST_WORKER"] = "" | ||
updated_path = configuration_manager.suffix_pytest_xdist_worker_id_to_dir( | ||
foo_path | ||
) | ||
self.assertFalse("gw1" in str(updated_path)) | ||
|
||
def test_prefix_worker_id_to_path_in_generic_utils(self): | ||
os.environ["PYTEST_XDIST_WORKER"] = "gw1" | ||
foo_path = Path("foo") | ||
updated_path = prefix_worker_id_to_path(foo_path) | ||
self.assertTrue("gw1" in str(updated_path)) | ||
|
||
os.environ["PYTEST_XDIST_WORKER"] = "" | ||
updated_path = prefix_worker_id_to_path(foo_path) | ||
self.assertFalse("gw1" in str(updated_path)) |