Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt test fixtures #5

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

TheByronHimes
Copy link
Member

Remove the use of the second_s3 fixture from tests. The tests had a flaw with resetting state and the current hexkit fixture setup doesn't allow for multiple containers (this might need to be adapted in the future). The intention with the affected tests in this PR was originally to test potential side effects when multiple storage nodes exist. This could/should be tested with integration tests later, but that still might require the ability to instantiate more than one s3 container.

The changes to both IRS and IFRS tests are basically:

  • Remove second_s3 fixture
  • Remove for loop in tests iterating through s3/second_s3 fixtures, then unindent everything that was under it (responsible for big change block)
  • Only use node1 storage location (did not check super closely for this)
  • Move container fixtures to conftest.py in the root test dir for each service
  • Move keypair regen and bucket population logic to be outside of joint fixture (now defined in conftest)
  • Make joint fixture function scope by default by removing the get_joint_fixture part (and import into conftest so it's always available)
  • Remove some pragma statements like F811

@TheByronHimes TheByronHimes merged commit e38a676 into fix/service_level_changes May 24, 2024
18 of 19 checks passed
@TheByronHimes TheByronHimes deleted the adapt_test_fixtures branch May 24, 2024 12:09
TheByronHimes added a commit that referenced this pull request Jun 4, 2024
* Initial commit

* Feature/init repo gdev 1274 (#2)

* Initial config changes, replacing repo name, removing unneeded content


Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Feature/upload functionality gdev 1275 (#3)

* Implemented FastAPI Endpoint for extracttion of file secrets and content offsets
* Currently store file secrets internally in MongoDB
* Inject GHGA keypair from environment

Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com>
Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* SecretStr adjustments (#5)

Config now uses appropriate fields (like SecretStr).
Simplified test code

Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Feature/eks download functionality gdev 1276 (#6)

Added Download functionality (GDEV-1276)
Wrote Integration tests (GDEV-1279)
Bumped chassis lib, hexkit version and updated to new template version

Co-authored-by: Thomas Zajac <thomas-jakob.zajac@uni-tuebingen.de>
Co-authored-by: Kersten Breuer <kersten-breuer@outlook.com>

* Feature/simplify encoding gdev 1384 (#7)

Changed encoding of base64 bytes objects to use utf-8 directly instead of hex representation for conversion to string

Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com

* Feature/vault testcontainer gdev 1439 (#8)

Added testcontainer setup for HashiCorp vault
Added vault client wrapper

Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com>
Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Feature/replace mongodb gdev 1416 (#9)

Replaced MongoDB with HashiCorp Vault using hvac

Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com>
Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Prettier swagger gdev 1445 (#11)

Added Customization for OpenAPI/Swagger

* Fixed oversights, updated dependencies (#12)

Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com>

* Updated chassis-lib and openapi.yaml (#13)

* Fixed missing async context for run_server (#14)

* Update Dockerfile

* Added container scanning and signing (#15)

* Update dev_cd.yaml (#16)

Co-authored-by: Thomas J. Zajac <thomas-jakob.zajac@uni-tuebingen.de>

* Added new secret (#17)

Added creation of a new secret in preparation of re-encryption

* Fix/current dependencies (#18)

* Updates from template
* Updated license headers
* Updated hexkit and chassis-lib
* httpx for fastpi issues

* Fix/enhanced error handling gdev 1590 (#19)

Added errors for vault-specific issues in upload path with proposed error codes

Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Update Dockerfile (#20)

* Fix/change credential type gdev 1613 (#21)

Changed vault authentication engine to approle

Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>

* Added global config for vault over http (#22)

* Updated mypy to 1.0.0 (#23)

Updated mypy to 1.0.0

* Update Template (#24)

Updated Template Files

* Added manual run of dev_cd (#25)

* Added manual run of dev_cd

Co-authored-by: Moritz Hahn <moritz.hahn@uni-tuebingen.de>

* Added Handover Documents (#26)

Switched to new Readme - Generation
Wrote Service description

Co-authored-by: Kersten Breuer <kersten-breuer@outlook.com>
Co-authored-by: Thomas Zajac <thomas-jakob.zajac@uni-tuebingen.de>

* Add file secret deletion handling gsi 132 (#27)

Added deletion Endpoint
Removed High-level business logic from fastapi adapter

* Add deletion description (#28)

Document the previous PR

* Fixed vault.delete_secret (#29)

Made v2 explicit instead of setting it in constructor
Replaced v1 delete method with v2 one nuking all key info for path
Added test for correct deletion

* update dependencies (GSI-181) (#30)

update hexkit

* Apply template changes (GSI 397) (#31)

* Update template files

* Deal with mypy

* Update openapi docs/readme

* Resolve deprecation warning for hashicorp

---------

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>

* add health endpoint to service api (#32)

* add health endpoint

* version bump

* update openapi yaml

* Added ca_bundle_location config, simplified vault URL (#33)

Co-authored-by: Christoph Zwerschke <cito@online.de>

* Fix dependencies (#34)

* Expose vault path as option (#35)

* Upgrade pydantic and devcontainer (GSI-438)

Upgrades to pydantic v2.

Switches to docker-outside-of-docker for the devcontainer environment.

Bumps version to 1.0.0.

* Validate setting for vault CA bundle (GSI-462) (#37)

* Add Kubernetes authentication (#38)

* Remove black and update ruff

* Support Kubernetes auth

* Template updates

* Ignore type error

* Move `if not all` to `else` block

* Fix mypy ignores default values

* Use configured logging (GSI-567) (#39)

* Update template files

* Use configured logging

* Update config, readme, openapi spec

---------

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>

* Add 'lock' to reqs file path (#40)

Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>

* Add configurable mount point for secret engines (#41)

* Add configurable mount point for secret engines

* Consolidate service files into subdir for ekss

* Integrate the EKSS

* Update the util script for openapi in ekss

* Fix some readme and docs issues

* Prevent double dashes in README

---------

Co-authored-by: Thomas Zajac <thomas-jakob.zajac@uni-tuebingen.de>
Co-authored-by: Moritz Hahn <Moritz.Hahn@uni-tuebingen.de>
Co-authored-by: KerstenBreuer <kersten-breuer@outlook.com>
Co-authored-by: Moritz Hahn <75744178+MoritzHahn1337@users.noreply.github.com>
Co-authored-by: Alexander Kyumurkov <akyumurkov@tutanota.com>
Co-authored-by: Alexander Kyumurkov <kyumurkov@uni-koeln.de>
Co-authored-by: TheByronHimes <TheByronHimes@gmail.com>
Co-authored-by: Seyit Zor <seyitzor@gmail.com>
Co-authored-by: Christoph Zwerschke <cito@online.de>
Co-authored-by: Christoph Zwerschke <c.zwerschke@dkfz-heidelberg.de>
Co-authored-by: Camill Kaipf <87362681+ckaipf@users.noreply.github.com>
TheByronHimes pushed a commit that referenced this pull request Jun 6, 2024
TheByronHimes pushed a commit that referenced this pull request Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants