-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration tests for sources/patches
Signed-off-by: Nikola Forró <nforro@redhat.com>
- Loading branch information
Showing
12 changed files
with
158 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT |
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,11 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT | ||
|
||
from pathlib import Path | ||
|
||
TESTS_DIR = Path(__file__).parent | ||
DATA_DIR = TESTS_DIR / "data" | ||
SPEC_MINIMAL = DATA_DIR / "spec_minimal" | ||
SPEC_PATCHLIST = DATA_DIR / "spec_patchlist" | ||
|
||
SPECFILE = "test.spec" |
File renamed without changes.
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,18 @@ | ||
From b7af0b9194585c6d208de3a0e9978d5ad9c5d97b Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com> | ||
Date: Wed, 16 Mar 2022 10:29:59 +0100 | ||
Subject: [PATCH 1/3] patch0 | ||
|
||
--- | ||
test.txt | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/test.txt b/test.txt | ||
index 9daeafb..dec2cbe 100644 | ||
--- a/test.txt | ||
+++ b/test.txt | ||
@@ -1 +1,2 @@ | ||
test | ||
+test | ||
-- | ||
2.35.1 |
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,19 @@ | ||
From 6d5d1561b3ccf2df9d001a7af011144acc352361 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com> | ||
Date: Wed, 16 Mar 2022 10:30:15 +0100 | ||
Subject: [PATCH 2/3] patch1 | ||
|
||
--- | ||
test.txt | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/test.txt b/test.txt | ||
index dec2cbe..0867e73 100644 | ||
--- a/test.txt | ||
+++ b/test.txt | ||
@@ -1,2 +1,3 @@ | ||
test | ||
test | ||
+test | ||
-- | ||
2.35.1 |
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,20 @@ | ||
From ae1d3bbca0caf1cce1842ceab4c6d7252c0a7bd8 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com> | ||
Date: Wed, 16 Mar 2022 10:30:29 +0100 | ||
Subject: [PATCH 3/3] patch2 | ||
|
||
--- | ||
test.txt | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/test.txt b/test.txt | ||
index 0867e73..d0c7fbe 100644 | ||
--- a/test.txt | ||
+++ b/test.txt | ||
@@ -1,3 +1,4 @@ | ||
test | ||
test | ||
test | ||
+test | ||
-- | ||
2.35.1 |
Binary file not shown.
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,27 @@ | ||
Name: test | ||
Version: 0.1 | ||
Release: 1%{?dist} | ||
Summary: Test package | ||
|
||
License: MIT | ||
|
||
Source: %{name}-%{version}.tar.xz | ||
Patch0: patch0.patch | ||
|
||
|
||
%description | ||
Test package | ||
|
||
|
||
%patchlist | ||
patch1.patch | ||
patch2.patch | ||
|
||
|
||
%prep | ||
%autosetup | ||
|
||
|
||
%changelog | ||
* Thu Jun 07 2018 Nikola Forró <nforro@redhat.com> - 0.1-1 | ||
- first version |
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,2 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT |
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,22 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT | ||
|
||
import shutil | ||
|
||
import pytest | ||
|
||
from tests.constants import SPEC_MINIMAL, SPEC_PATCHLIST, SPECFILE | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def spec_minimal(tmp_path): | ||
specfile_path = tmp_path / SPECFILE | ||
shutil.copyfile(SPEC_MINIMAL / SPECFILE, specfile_path) | ||
return specfile_path | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def spec_patchlist(tmp_path): | ||
destination = tmp_path / "spec_patchlist" | ||
shutil.copytree(SPEC_PATCHLIST, destination) | ||
return destination / SPECFILE |
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,2 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT |