-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jaime Silvela <jaime.silvela@enterprisedb.com>
- Loading branch information
Showing
7 changed files
with
146 additions
and
0 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,16 @@ | ||
on: [push] | ||
|
||
jobs: | ||
plain_test: | ||
runs-on: ubuntu-latest | ||
name: Unit test | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: python -m pip install --upgrade pip prettytable | ||
- name: Run suite | ||
run: python test_summary.py -v |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# editor and IDE paraphernalia | ||
.idea | ||
__pycache__/ |
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
17 changes: 17 additions & 0 deletions
17
few-artifacts/id1_0b185c51a60964ecab5bb7d97458ca95fd421f325f3896ed239d5d3f.json
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,17 @@ | ||
{ | ||
"name": "InitDB settings - custom default locale -- use the custom default locale specified", | ||
"state": "passed", | ||
"start_time": "2021-11-29T18:29:12.613387+01:00", | ||
"end_time": "2021-11-29T18:31:07.988145+01:00", | ||
"error": "", | ||
"error_file": "", | ||
"error_line": 0, | ||
"platform": "local", | ||
"postgres_kind": "PostgreSQL", | ||
"matrix_id": "id1", | ||
"postgres_version": "11.1", | ||
"k8s_version": "22", | ||
"workflow_id": 12, | ||
"repo": "my-repo", | ||
"branch": "my-branch" | ||
} |
17 changes: 17 additions & 0 deletions
17
few-artifacts/id1_4902843ff6a60bc4fdb76000698c46de8e7f9763a1a0fe63f70fd5f8.json
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,17 @@ | ||
{ | ||
"name": "InitDB settings - initdb custom post-init SQL scripts -- can find the tables created by the post-init SQL queries", | ||
"state": "failed", | ||
"start_time": "2021-11-29T18:28:37.198931+01:00", | ||
"end_time": "2021-11-29T18:29:12.613157+01:00", | ||
"error": "Expected\n <string>: 1\\n\nto equal\n <string>: 2\\n", | ||
"error_file": "/Users/jaime.silvela/repos/cloud-native-postgresql/tests/e2e/initdb_test.go", | ||
"error_line": 80, | ||
"platform": "local", | ||
"postgres_kind": "PostgreSQL", | ||
"matrix_id": "id1", | ||
"postgres_version": "11.1", | ||
"k8s_version": "22", | ||
"workflow_id": 12, | ||
"repo": "my-repo", | ||
"branch": "my-branch" | ||
} |
17 changes: 17 additions & 0 deletions
17
few-artifacts/id1_9891d0d1caa1ec8fd0adfe622e341f84dd3d1df1cffee843e1fb84a0.json
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,17 @@ | ||
{ | ||
"name": "ignoreFails on e2e tests -- generates a failing tests that should be ignored", | ||
"state": "ignoreFailed", | ||
"start_time": "0001-01-01T00:00:00Z", | ||
"end_time": "0001-01-01T00:00:00Z", | ||
"error": "", | ||
"error_file": "", | ||
"error_line": 0, | ||
"platform": "local", | ||
"postgres_kind": "PostgreSQL", | ||
"matrix_id": "id1", | ||
"postgres_version": "11.1", | ||
"k8s_version": "22", | ||
"workflow_id": 12, | ||
"repo": "my-repo", | ||
"branch": "my-branch" | ||
} |
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,70 @@ | ||
# | ||
# Copyright The CloudNativePG Contributors | ||
# | ||
# 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 unittest | ||
import summarize_test_results | ||
import datetime | ||
|
||
|
||
class TestIsFailed(unittest.TestCase): | ||
def test_compute_summary(self): | ||
self.maxDiff = None | ||
summary = summarize_test_results.compute_test_summary("few-artifacts") | ||
self.assertEqual(summary["total_run"], 3) | ||
self.assertEqual(summary["total_failed"], 1) | ||
|
||
self.assertEqual( | ||
summary["by_code"]["total"], | ||
{ | ||
"/Users/jaime.silvela/repos/cloud-native-postgresql/tests/e2e/initdb_test.go:80": 1 | ||
}, | ||
"unexpected summary", | ||
) | ||
self.assertEqual( | ||
summary["by_code"]["tests"], | ||
{ | ||
"/Users/jaime.silvela/repos/cloud-native-postgresql/tests/e2e/initdb_test.go:80": { | ||
"InitDB settings - initdb custom post-init SQL scripts -- can find the tables created by the post-init SQL queries": True | ||
} | ||
}, | ||
"unexpected summary", | ||
) | ||
self.assertEqual( | ||
summary["by_matrix"], {"total": {"id1": 3}, "failed": {"id1": 1}} | ||
) | ||
self.assertEqual(summary["by_k8s"], {"total": {"22": 3}, "failed": {"22": 1}}) | ||
self.assertEqual( | ||
summary["by_platform"], {"total": {"local": 3}, "failed": {"local": 1}} | ||
) | ||
self.assertEqual( | ||
summary["by_postgres"], | ||
{"total": {"PostgreSQL-11.1": 3}, "failed": {"PostgreSQL-11.1": 1}}, | ||
) | ||
self.assertEqual( | ||
summary["suite_durations"], | ||
{ | ||
"end_time": { | ||
"local": {"id1": datetime.datetime(2021, 11, 29, 18, 31, 7)} | ||
}, | ||
"start_time": { | ||
"local": {"id1": datetime.datetime(2021, 11, 29, 18, 28, 37)} | ||
}, | ||
}, | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |