Skip to content

Commit

Permalink
Merge pull request #28 from biosafetylvl5/int-tests
Browse files Browse the repository at this point in the history
Add integration tests, fix date bug
  • Loading branch information
biosafetylvl5 authored Oct 14, 2024
2 parents 086b10e + b208ecb commit 018f390
Show file tree
Hide file tree
Showing 17 changed files with 808 additions and 182 deletions.
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
markers =
integtest: mark a test as an integration test.
24 changes: 23 additions & 1 deletion src/brassy/templates/release_yaml_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from typing import List, Optional, Dict
from datetime import date as Date

import dateparser

from pydantic import (
BaseModel,
HttpUrl,
Expand All @@ -10,6 +12,7 @@
RootModel,
Field,
field_validator,
validator,
)


Expand Down Expand Up @@ -45,12 +48,31 @@ class DateRange(BaseModel):
start: Optional[Date]
finish: Optional[Date]

@validator("start", "finish", pre=True, always=True)
def parse_date(cls, value):
if value is None or isinstance(value, Date):
return value
if isinstance(value, str):
value = value.strip()
if not value or value.lower() in ["never", "null"]:
return None
try:
parsed = dateparser.parse(value)
if parsed is None:
raise ValueError(f"Unable to parse date string: {value}")
return parsed.date()
except Exception as e:
raise ValueError(f"Invalid date format: {value}") from e
raise ValueError(f"Invalid type for date field: {value}")


class ChangeItem(BaseModel):
title: str
description: str
files: Files
related_issue: Optional[RelatedIssue] = Field(alias="related-issue")
related_issue: Optional[RelatedIssue] = Field(
alias="related-issue", exclude_unset=True, default=None
)
date: Optional[DateRange] = None


Expand Down
26 changes: 0 additions & 26 deletions test/575-cli-class-factory.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions test/burgers.rst

This file was deleted.

11 changes: 0 additions & 11 deletions test/burgers.yaml

This file was deleted.

1 change: 0 additions & 1 deletion test/test.py

This file was deleted.

19 changes: 0 additions & 19 deletions test/test.rst

This file was deleted.

105 changes: 0 additions & 105 deletions test/test2.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions tests/inputs/barebones.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bug fix:
- title: Test bug fix.
description: 'This fixes all computer bugs ever written.'
files:
moved:
- linux/src
141 changes: 141 additions & 0 deletions tests/inputs/fully-featured.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
bug fix:
- title: "Fixed Aang's Avatar State Ⓐ"
description: |
Resolved an issue where Aang could not exit the Avatar State after consuming cactus juice. This caused unintended behavior and prevented progression in the story.
files:
deleted:
- ''
moved:
- 'src/characters/aang_temp.py:src/characters/aang.py'
added:
- ''
modified:
- 'src/avatar/avatar_state_manager.py'
related-issue:
number: 1001
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1001'
date:
start: '2023/01/01'
finish: '2023-01-05T23:59:59Z'

enhancement:
- title: 'Implemented Multi-Element Bending for Avatars'
description: |
Avatars can now bend multiple elements simultaneously, allowing for more complex combat strategies.
files:
deleted:
- ''
moved:
- ''
added:
- 'src/bending/multi_element.py'
modified:
- 'src/avatar/avatar_core.py'
- 'src/bending/bending_manager.py'
related-issue:
number: '1000000000000000000000000000000000000000000000'
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1000000000000000000000000000000000000000000000'
date:
start: '2023-03-01T00:00:00'
finish: '2023-03-10T23:59:59Z'

deprecation:
- title: 'Deprecated Old Bending Stances'
description: |
The classic bending stances are deprecated in favor of dynamic stances that adapt to the situation.
files:
deleted:
- ''
moved:
- ''
added:
- ''
modified:
- 'assets/animations/stances/*'
related-issue:
number: null
repo_url: ''
date:
start: 'Yesterday'
finish: 'Today'

removal:
- title: 'Removed Unagi Sea Serpent from Kyoshi Island'
description: |
The Unagi has been removed due to community feedback regarding difficulty levels.
files:
deleted:
- 'assets/creatures/unagi.obj'
- 'src/creatures/unagi_behavior.py'
moved:
- ''
added:
- ''
modified:
- 'src/locations/kyoshi_island.py'
related-issue:
number: '1005'
repo_url: 'https://github.com/AvatarProject/AvatarRepo/'
date:
start: '2023-05-01'
finish: 'Never'

performance:
- title: 'Optimized Fire Nation Ship Rendering'
description: |
Improved rendering performance for Fire Nation ships by 50% by reducing polygon count and optimizing textures.
files:
deleted:
- ''
moved:
- ''
added:
- ''
modified:
- 'assets/vehicles/fire_nation_ship.obj'
related-issue:
number: 1006
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1006'
date:
start: '2023-07-01'
finish: '2023-07-15'

documentation:
- title: 'Added Documentation for Combustion Bending'
description: |
New documentation explains the mechanics and limitations of combustion bending.
files:
deleted:
- ''
moved:
- ''
added:
- 'docs/bending/combustion_bending.md'
modified:
- ''
related-issue:
number: 1008
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1008'
date:
start: '2023-08-05'
finish: '2023-08-10'

continuous integration:
- title: 'Implemented Nightly Builds for the Fire Nation Branch'
description: |
Set up nightly builds and tests for the Fire Nation development branch to ensure stability.
files:
deleted:
- ''
moved:
- ''
added:
- '.github/workflows/nightly_fire_nation.yml'
modified:
- ''
related-issue:
number: 1009
repo_url: 'https://github.com/AvatarProject/AvatarRepo/issues/1009'
date:
start: '2023-09-01'
finish: '2023-09-02'
Loading

0 comments on commit 018f390

Please sign in to comment.