Skip to content

Commit

Permalink
Merge pull request AdaCore#706 from enzbang/fix-tests
Browse files Browse the repository at this point in the history
Make testsuite more robust
  • Loading branch information
enzbang authored Mar 26, 2024
2 parents 1f6fac4 + cd79be8 commit f1a4a60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 2 additions & 8 deletions tests/tests_e3/os/process/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def run_test():
e.restore()


@pytest.mark.skipif(sys.platform == "win32", reason="A linux test")
@pytest.mark.skipif(sys.platform == "win32", reason="A linux/macOS test")
def test_rlimit_ctrl_c():
"""Test rlimit CTRL-C.
Expand Down Expand Up @@ -164,9 +164,6 @@ def test_rlimit_ctrl_c():
except ImportError:
raise ImportError("ptyprocess is needed to run this tests") from None

# Only a linux test
assert sys.platform.startswith("linux"), "This test make sens only on linux"

script_to_run = """
from __future__ import annotations
Expand All @@ -193,7 +190,7 @@ def test_rlimit_ctrl_c():
assert int(end - start) < 30, f"CTRL-C failed: take {int(end - start)} seconds"


@pytest.mark.skipif(sys.platform == "win32", reason="A linux test")
@pytest.mark.skipif(sys.platform != "linux", reason="A linux test")
def test_rlimit_foreground_option():
"""Test rlimit --foreground.
Expand All @@ -204,9 +201,6 @@ def test_rlimit_foreground_option():
except ImportError:
raise ImportError("ptyprocess is needed to run this tests") from None

# Only a linux test
assert sys.platform.startswith("linux"), "This test make sens only on linux"

# Test with --foreground
os.environ["PS1"] = "$ "
# Use TERM=dummy to avoid prompt coloring to interfere with the result
Expand Down
5 changes: 4 additions & 1 deletion tests/tests_e3/vcs/git/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def test_git_repo():
repo.git_cmd(["config", "user.email", "[email protected]"])
repo.git_cmd(["config", "user.name", "e3 core"])
repo.git_cmd(["commit", "-m", "new file"])

main_branch = repo.git_cmd(["branch", "--show-current"]).out

repo.git_cmd(["tag", "-a", "-m", "new tag", "20.0855369232"])
repo.git_cmd(["notes", "--ref", "review", "add", "HEAD", "-F", commit_note])

Expand Down Expand Up @@ -130,7 +133,7 @@ def test_git_repo():
repo2 = GitRepository(working_tree2)
giturl = "file://%s" % working_tree.replace("\\", "/")
repo2.init(url=giturl, remote="tree1")
repo2.update(url=giturl, refspec="master")
repo2.update(url=giturl, refspec=main_branch)
assert repo2.rev_parse() == repo.rev_parse()

repo2.fetch_gerrit_notes(url=giturl)
Expand Down

0 comments on commit f1a4a60

Please sign in to comment.