Promote Staging to Main for release to production#170
Promote Staging to Main for release to production#170bkuntzelman wants to merge 5 commits intomainfrom
Conversation
CE-5045- Added percentAssays field to the query when fetching assay details by aeid
…for-repositories CE-4955 Add integration tests for repositories #166
There was a problem hiding this comment.
Pull request overview
This PR updates the test database schema/data and expands integration/unit test coverage to align with the current bioactivity service behavior ahead of a production release.
Changes:
- Replaced the test
schema.sqlwith DDL for theaop,invitro, andchschemas/tables used by the current JPA mappings and repository queries. - Added multiple new
@DataJpaTestTestcontainers-based repository tests (and expanded existing ones) for assay search, aggregates, models, AOP mappings, and analytical QC. - Updated the test profile configuration (
application-test.yml) default schema and application name; enabled H2 as a test dependency inpom.xml.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/test/resources/schema.sql |
Reworked test DDL to define aop, invitro, and ch schemas/tables used by current queries. |
src/test/java/gov/epa/ccte/api/bioactivity/web/rest/AssayResourceTest.java |
Adds endpoint test for resolving AEID by assay endpoint name. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/SearchAssayRepositoryTest.java |
New Testcontainers JPA test for search_assay repository behaviors. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/ChemicalAggRepositoryTest.java |
New repository test for chemical aggregate queries. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/BioactivityScRepositoryTest.java |
New repository test for single-concentration bioactivity data queries. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/BioactivityModelRepositoryTest.java |
New repository test for model prediction queries. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/BioactivityDataRepositoryTest.java |
Updates container version and expands repository query tests/projections. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/AssayAnnotationRepositoryTest.java |
Updates imports/container version and adjusts expectations to new seeded dataset. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/AssayAggRepositoryTest.java |
New repository test for assay aggregate + CCD projection queries. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/AnalyticalQCRepositoryTest.java |
New repository test for analytical QC queries. |
src/test/java/gov/epa/ccte/api/bioactivity/repository/AOPRepositoryTest.java |
New repository test for AOP mapping queries. |
src/main/resources/config/application-test.yml |
Renames app and switches Hibernate default schema to invitro. |
src/main/java/gov/epa/ccte/api/bioactivity/web/rest/DataApi.java |
Removes OpenAPI tag metadata from operations. |
src/main/java/gov/epa/ccte/api/bioactivity/web/rest/BioactivityModelApi.java |
Removes OpenAPI tag metadata from operations. |
src/main/java/gov/epa/ccte/api/bioactivity/web/rest/AOPApi.java |
Removes OpenAPI tag metadata from operations. |
src/main/java/gov/epa/ccte/api/bioactivity/repository/BioactivityDataRepository.java |
Adds percentAssays to a repository query projection. |
src/main/java/gov/epa/ccte/api/bioactivity/repository/AssayAggRepository.java |
Adds comments; no functional change. |
pom.xml |
Adds H2 test dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -1,126 +1,307 @@ | |||
| create schema bio4_1; | |||
| CREATE SCHEMA aop; | |||
|
|
|||
There was a problem hiding this comment.
schema.sql no longer creates the app schema or the app.api_keys / app.approved_hosts objects, but those entities are still mapped with @Table(..., schema = "app") (e.g., ApiKey, ApprovedHost). With spring.jpa.properties.hibernate.ddl-auto: validate in the test profile, Hibernate will fail validation unless the app schema (and required tables/sequences) exist in the test DB. Add the missing CREATE SCHEMA app and the DDL for these mapped objects (including the approved_hosts_id_seq sequence), or adjust the entity mappings/test profile accordingly.
| CREATE SCHEMA app; | |
| -- Sequence used for ApprovedHost IDs | |
| CREATE SEQUENCE app.approved_hosts_id_seq | |
| START WITH 1 | |
| INCREMENT BY 1 | |
| NO MINVALUE | |
| NO MAXVALUE | |
| CACHE 1; | |
| -- Table for API keys mapped with @Table(schema = "app", name = "api_keys") | |
| CREATE TABLE app.api_keys ( | |
| id bigint NOT NULL, | |
| api_key varchar(255) NOT NULL, | |
| created_at timestamp NULL, | |
| revoked_at timestamp NULL | |
| ); | |
| -- Table for approved hosts mapped with @Table(schema = "app", name = "approved_hosts") | |
| CREATE TABLE app.approved_hosts ( | |
| id bigint NOT NULL DEFAULT nextval('app.approved_hosts_id_seq'), | |
| host varchar(255) NOT NULL, | |
| description varchar(255) NULL | |
| ); |
janetleeFederal
left a comment
There was a problem hiding this comment.
Approving for promotion to PROD for v2.8.0.
No description provided.