Skip to content

Commit

Permalink
Merge pull request #750 from tschmidtb51/timestamp-timezone-sorting
Browse files Browse the repository at this point in the history
Clarify Timezones in multiple tests
  • Loading branch information
tschmidtb51 committed May 31, 2024
2 parents 3581490 + 6d7329e commit 44bef84
Show file tree
Hide file tree
Showing 17 changed files with 504 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

It MUST be tested that the value of `number` of items of the revision history are sorted ascending when the items are sorted
ascending by `date` and as a second level criteria `number`.
As the timestamps might use different timezones, the sorting MUST take timezones into account.

The relevant path for this test is:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

It MUST be tested that document version has the same value as the `number` in the last item of the revision history when
it is sorted ascending by `date` and as a second level criteria `number`.
As the timestamps might use different timezones, the sorting MUST take timezones into account.
Build metadata is ignored in the comparison.
Any pre-release part is also ignored if the document status is `draft`.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### Missing Item in Revision History

It MUST be tested that items of the revision history do not omit a version number when the items are sorted ascending by `date`.
As the timestamps might use different timezones, the sorting MUST take timezones into account.
In the case of semantic versioning, this applies only to the Major version.
It MUST also be tested that the first item in such a sorted list has either the version number 0 or 1 in the case of integer versioning or
a Major version of 0 or 1 in the case of semantic versioning.
Expand Down
2 changes: 2 additions & 0 deletions csaf_2.1/prose/edit/src/tests-02-optional.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ The relevant path for this test is:
### Older Initial Release Date than Revision History

It MUST be tested that the Initial Release Date is not older than the `date` of the oldest item in Revision History.
As the timestamps might use different timezones, the sorting and comparison MUST take timezones into account.

The relevant path for this test is:

Expand Down Expand Up @@ -175,6 +176,7 @@ The relevant path for this test is:
### Older Current Release Date than Revision History

It MUST be tested that the Current Release Date is not older than the `date` of the newest item in Revision History.
As the timestamps might use different timezones, the sorting and comparison MUST take timezones into account.

The relevant path for this test is:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Sorted Revision History (failing example 9)",
"tracking": {
"current_release_date": "2024-01-22T22:45:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-14-09",
"initial_release_date": "2024-01-22T22:00:00.000Z",
"revision_history": [
{
"date": "2024-01-23T10:00:00.000-12:00",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-22T10:00:00.000+12:45",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Sorted Revision History (valid example 10)",
"tracking": {
"current_release_date": "2024-01-22T22:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-14-31",
"initial_release_date": "2024-01-22T22:45:00.000Z",
"revision_history": [
{
"date": "2024-01-22T10:00:00.000+12:45",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-23T10:00:00.000-12:00",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Latest Document Version (failing example 9)",
"tracking": {
"current_release_date": "2024-01-22T22:45:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-16-09",
"initial_release_date": "2024-01-22T22:00:00.000Z",
"revision_history": [
{
"date": "2024-01-23T10:00:00.000-12:00",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-22T10:00:00.000+12:45",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Latest Document Version (valid example 11)",
"tracking": {
"current_release_date": "2024-01-22T22:45:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-16-32",
"initial_release_date": "2024-01-22T22:00:00.000Z",
"revision_history": [
{
"date": "2024-01-22T10:00:00.000+12:45",
"number": "2",
"summary": "Second version."
},
{
"date": "2024-01-23T10:00:00.000-12:00",
"number": "1",
"summary": "Initial version."
}
],
"status": "final",
"version": "2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Item in Revision History (failing example 3)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-21-03",
"initial_release_date": "2023-08-22T10:00:00.000Z",
"revision_history": [
{
"date": "2023-08-22T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "4",
"summary": "Some other changes."
},
{
"date": "2024-01-21T11:00:00.000+03:00",
"number": "3",
"summary": "Some other changes."
}
],
"status": "final",
"version": "4"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Mandatory test: Missing Item in Revision History (valid example 4)",
"tracking": {
"current_release_date": "2024-01-21T14:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-1-21-14",
"initial_release_date": "2023-08-22T10:00:00.000Z",
"revision_history": [
{
"date": "2023-08-22T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T10:00:00.000Z",
"number": "3",
"summary": "Some other changes."
},
{
"date": "2024-01-21T11:00:00.000+03:00",
"number": "2",
"summary": "Some other changes."
},
{
"date": "2024-01-21T09:00:00.000-05:00",
"number": "4",
"summary": "Some other changes."
}
],
"status": "final",
"version": "4"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Older Initial Release Date than Revision History (failing example 2)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-02",
"initial_release_date": "2023-09-06T10:00:00.000+10:00",
"revision_history": [
{
"date": "2023-09-06T10:00:00.000-01:00",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T11:00:00.000Z",
"number": "2",
"summary": "Second version."
}
],
"status": "final",
"version": "2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Older Initial Release Date than Revision History (valid example 1)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-11",
"initial_release_date": "2023-09-06T10:00:00.000Z",
"revision_history": [
{
"date": "2023-09-06T10:00:00.000Z",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T11:00:00.000Z",
"number": "2",
"summary": "Second version."
}
],
"status": "final",
"version": "2"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"document": {
"category": "csaf_base",
"csaf_version": "2.1",
"distribution": {
"tlp": {
"label": "CLEAR"
}
},
"publisher": {
"category": "other",
"name": "OASIS CSAF TC",
"namespace": "https://csaf.io"
},
"title": "Optional test: Older Initial Release Date than Revision History (valid example 2)",
"tracking": {
"current_release_date": "2024-01-21T10:00:00.000Z",
"id": "OASIS_CSAF_TC-CSAF_2.1-2024-6-2-05-12",
"initial_release_date": "2023-09-06T10:00:00.000+10:00",
"revision_history": [
{
"date": "2023-09-06T10:00:00.000+10:00",
"number": "1",
"summary": "Initial version."
},
{
"date": "2024-01-21T11:00:00.000Z",
"number": "2",
"summary": "Second version."
}
],
"status": "final",
"version": "2"
}
}
}

0 comments on commit 44bef84

Please sign in to comment.