Skip to content

Conversation

@rh-amarin
Copy link
Contributor

The only "real" file changed by this PR is the openapi.yaml all the other files were generated by make generate

IMO created_at and updated_at do not belong to ObjectReference
At least to my understanding this object holds the information to point to an entity, via its kind, id and href properties.

Tests







┌[kiwish-4.2]-(trex/object-reference)-[git:object-reference*]-
└> export TESTCONTAINERS_RYUK_DISABLED=true
┌[kiwish-4.2]-(trex/object-reference)-[git:object-reference*]-
└> make test-integration 
CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go install -ldflags="-X github.com/openshift-online/rh-trex/pkg/api.Version=6fe560f-m
odified -X 'github.com/openshift-online/rh-trex/pkg/api.BuildTime=2025-11-07 11:46:51 UTC'" ./cmd/trex
# github.com/shoenig/go-m1cpu
/Users/amarin/.asdf/installs/golang/1.22.12/packages/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:75:17: warning: variab
le length array folded to constant array as an extension [-Wgnu-folding-constant]
/Users/amarin/.asdf/installs/golang/1.22.12/packages/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:77:16: warning: variab
le length array folded to constant array as an extension [-Wgnu-folding-constant]
OCM_ENV=integration_testing gotestsum --format short-verbose -- -p 1 -ldflags -s -v -timeout 1h  \
                        ./test/integration
I1107 12:47:03.745241   77366 framework.go:69] Initializing integration_testing environment
I1107 12:47:03.751971   77366 testcontainer.go:44] Starting PostgreSQL testcontainer...
2025/11/07 12:47:03 github.com/testcontainers/testcontainers-go - Connected to docker: 
  Server Version: 5.5.2
  API Version: 1.41
  Operating System: fedora
  Total Memory: 1947 MB
  Testcontainers for Go Version: v0.33.0
  Resolved Docker Host: unix:///var/run/docker.sock
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: deb2c8f5863960d36d884a728f45e6a60026b6659ca22c62857445cd6c745ee9
  Test ProcessID: e9956ce2-c22f-4ce7-b0c0-300bec326e97
2025/11/07 12:47:03 🐳 Creating container for image postgres:14.2
2025/11/07 12:47:03 ✅ Container created: bc64be340aba
2025/11/07 12:47:03 🐳 Starting container: bc64be340aba
2025/11/07 12:47:04 ✅ Container started: bc64be340aba
2025/11/07 12:47:04 ⏳ Waiting for container id bc64be340aba image: postgres:14.2. Waiting for: &{timeout:<nil> deadline:0x14
00039c598 Strategies:[0x14000302480]}
2025/11/07 12:47:05 🔔 Container is ready: bc64be340aba
I1107 12:47:05.407977   77366 testcontainer.go:69] PostgreSQL testcontainer started at: postgres://trex:foobar-bizz-buzz@loca
lhost:32879/rhtrex?sslmode=disable
I1107 12:47:05.414123   77366 testcontainer.go:101] Running database migrations on testcontainer...
I1107 12:47:05.422216   77366 testcontainer.go:106] Testcontainer database initialized successfully
I1107 12:47:05.422248   77366 framework.go:148] Using Mock OCM Authz Client
I1107 12:47:05.422298   77366 framework.go:173] Disabling Sentry error reporting
I1107 12:47:05.462091   77366 openapi.go:40] Loaded fully resolved OpenAPI specification from embedded pkg/api/openapi/api/op
enapi.yaml
I1107 12:47:05.462128   77366 openapi.go:50] Loaded OpenAPI UI HTML from embedded file
I1107 12:47:05.462577   77366 api_server.go:143] Serving without TLS at localhost:8000
I1107 12:47:05.462664   77366 healthcheck_server.go:56] Serving HealthCheck without TLS at localhost:8083
PASS test/integration.TestControllerRacing (1.18s)
PASS test/integration.TestDinosaurGet (0.01s)
PASS test/integration.TestDinosaurPost (0.01s)
PASS test/integration.TestDinosaurPatch (0.02s)
PASS test/integration.TestDinosaurPaging (0.04s)
PASS test/integration.TestDinosaurListSearch (0.03s)
PASS test/integration.TestUpdateDinosaurWithRacingRequests_BlockingAdvisoryLock (2.03s)
PASS test/integration.TestUpdateDinosaurWithRacingRequests_NonBlockingAdvisoryLock (1.02s)
PASS test/integration.TestUpdateDinosaurWithRacingRequests_WithoutLock (2.02s)
PASS test/integration.TestMetadataGet (0.01s)
PASS test/integration.TestOpenAPIGet (0.01s)
PASS test/integration.TestOpenAPIUIGet (0.00s)
I1107 12:47:11.829693   77366 api_server.go:149] Web server terminated
I1107 12:47:11.829722   77366 testcontainer.go:141] Stopping PostgreSQL testcontainer...
2025/11/07 12:47:11 🐳 Terminating container: bc64be340aba
E1107 12:47:11.845112   77366 logger.go:129]   pq: terminating connection due to administrator command 
E1107 12:47:11.845135   77366 logger.go:129]   pq: terminating connection due to administrator command 
E1107 12:47:11.845120   77366 logger.go:129]   pq: terminating connection due to administrator command 
2025/11/07 12:47:11 🚫 Container terminated: bc64be340aba
I1107 12:47:11.998461   77366 testcontainer.go:145] PostgreSQL testcontainer stopped
PASS test/integration

DONE 12 tests in 8.848s



└> make test
CGO_ENABLED=1 GOEXPERIMENT=boringcrypto go install -ldflags="-X github.com/openshift-online/rh-trex/pkg/api.Version=6fe560f-mo
dified -X 'github.com/openshift-online/rh-trex/pkg/api.BuildTime=2025-11-07 11:47:01 UTC'" ./cmd/trex
# github.com/shoenig/go-m1cpu
/Users/amarin/.asdf/installs/golang/1.22.12/packages/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:75:17: warning: variabl
e length array folded to constant array as an extension [-Wgnu-folding-constant]
/Users/amarin/.asdf/installs/golang/1.22.12/packages/pkg/mod/github.com/shoenig/go-m1cpu@v0.1.6/cpu.go:77:16: warning: variabl
e length array folded to constant array as an extension [-Wgnu-folding-constant]
OCM_ENV=unit_testing gotestsum --format short-verbose -- -p 1 -v  \
                ./pkg/... \
                ./cmd/...
EMPTY pkg/api
EMPTY pkg/api/openapi
EMPTY pkg/api/presenters
EMPTY pkg/auth
EMPTY pkg/client/ocm
PASS pkg/config.TestConfigReadStringFile (0.00s)
PASS pkg/config.TestConfigReadIntFile (0.00s)
PASS pkg/config.TestConfigReadBoolFile (0.00s)
PASS pkg/config.TestConfigReadQuotedFile (0.00s)
PASS pkg/config
PASS pkg/controllers.TestControllerFramework (0.00s)
PASS pkg/controllers
EMPTY pkg/dao
EMPTY pkg/dao/mocks
EMPTY pkg/db
EMPTY pkg/db/db_context
EMPTY pkg/db/db_session
EMPTY pkg/db/migrations
EMPTY pkg/db/mocks
EMPTY pkg/db/transaction
PASS pkg/errors.TestErrorFormatting (0.00s)
PASS pkg/errors.TestErrorFind (0.00s)
PASS pkg/errors
EMPTY pkg/handlers
EMPTY pkg/logger
PASS pkg/services.TestDinosaurFindBySpecies (0.00s)
PASS pkg/services.TestSQLTranslation (0.00s)
PASS pkg/services
EMPTY pkg/util
EMPTY cmd/trex
EMPTY cmd/trex/clone
PASS cmd/trex/environments.TestLoadServices (0.03s)
PASS cmd/trex/environments
EMPTY cmd/trex/environments/registry
EMPTY cmd/trex/migrate
EMPTY cmd/trex/servecmd
EMPTY cmd/trex/server
EMPTY cmd/trex/server/logging

DONE 10 tests in 5.992s

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.

1 participant