@@ -44,17 +44,10 @@ go-tests: ## Run Go services tests
4444 cd go && ./run_tests.sh
4545
4646api-server-tests : # # Run Go API server integration tests
47- test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
48- cd go && go build -o ./api ./cmd/api
49- cd gcp/api && docker build -f Dockerfile.esp -t osv/esp:latest .
50- cd gcp/api && OSV_USE_GO_BACKEND=1 ./run_tests.sh $(HOME ) /.config/gcloud/application_default_credentials.json
51- cd gcp/api && OSV_USE_GO_BACKEND=1 ./run_tests_e2e.sh $(HOME ) /.config/gcloud/application_default_credentials.json
47+ ./tools/apitester/run_tests.sh
5248
5349update-api-snapshots : # # Update API query snapshots
54- test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
55- cd go && go build -o ./api ./cmd/api
56- cd gcp/api && docker build -f Dockerfile.esp -t osv/esp:latest .
57- cd gcp/api && UPDATE_SNAPS=true OSV_USE_GO_BACKEND=1 ./run_tests_e2e.sh $(HOME ) /.config/gcloud/application_default_credentials.json
50+ UPDATE_SNAPS=true ./tools/apitester/run_tests.sh
5851
5952lint : # # Run linters and format checks
6053 GOTOOLCHAIN=auto $(run-cmd ) tools/lint_and_format.sh
@@ -63,33 +56,33 @@ build-osv-protos:
6356 cd osv && $(run-cmd ) python -m grpc_tools.protoc --python_out=. --mypy_out=. --proto_path=. --proto_path=osv-schema/proto vulnerability.proto importfinding.proto
6457
6558build-api-protos :
66- cd gcp/api/ v1 && $( run-cmd ) python -m grpc_tools. protoc \
59+ cd proto/ v1 && protoc \
6760 --include_imports \
6861 --include_source_info \
69- --proto_path =googleapis \
62+ --proto_path =.. \
7063 --proto_path=. \
71- --proto_path=osv \
72- --proto_path=osv/osv-schema/proto \
64+ --proto_path=../../ osv \
65+ --proto_path=../../ osv/osv-schema/proto \
7366 --descriptor_set_out=api_descriptor.pb \
74- --python_out=.. \
75- --grpc_python_out=.. \
76- --mypy_out=.. \
7767 vulnerability.proto importfinding.proto osv_service_v1.proto
7868 cd osv && protoc \
7969 --proto_path =. \
8070 --go_out=paths=source_relative:../bindings/go/api \
8171 importfinding.proto
82- cd gcp/api /v1 && protoc \
83- --proto_path =googleapis \
72+ cd proto /v1 && protoc \
73+ --proto_path =.. \
8474 --proto_path=. \
85- --proto_path=osv \
86- --proto_path=osv/osv-schema/proto \
87- --go_out=paths=source_relative:../../../ bindings/go/api \
88- --go-grpc_out=paths=source_relative:../../../ bindings/go/api \
75+ --proto_path=../../ osv \
76+ --proto_path=../../ osv/osv-schema/proto \
77+ --go_out=paths=source_relative:../../bindings/go/api \
78+ --go-grpc_out=paths=source_relative:../../bindings/go/api \
8979 osv_service_v1.proto
9080
9181build-protos : build-osv-protos build-api-protos # # Build all protocol buffers
9282
83+ build-swagger : # # Build Swagger/OpenAPI documentation
84+ ./docs/build_swagger.sh
85+
9386build-website-frontend :
9487 cd website/frontend3 && pnpm install && pnpm run build
9588 cd website/blog && hugo --buildFuture -d ../dist/static/blog
@@ -127,26 +120,15 @@ run-go-website-prod: stage-website-assets
127120# Run with `make run-api-server ARGS=--no-backend` to launch esp without backend.
128121run-api-server : # # Run local Go API server with ESPv2 proxy
129122 test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
130- docker inspect osv/esp:latest > /dev/null 2>&1 || (cd gcp/api && docker build -f Dockerfile. esp -t osv/esp:latest .)
123+ docker inspect osv/esp:latest > /dev/null 2>&1 || docker build -f docker/ esp/Dockerfile -t osv/esp:latest docker/esp
131124 @cd go && go build -o ./api-devserver ./cmd/api-devserver && (GOOGLE_CLOUD_PROJECT=oss-vdb OSV_VULNERABILITIES_BUCKET=osv-vulnerabilities ./api-devserver $( ARGS) ; EXIT_CODE=$$ ? ; rm -f ./api-devserver; exit $$ EXIT_CODE)
132125
133126# Run the Go developer server orchestrator against the staging/test environment.
134127run-api-server-test :
135128 test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
136- docker inspect osv/esp:latest > /dev/null 2>&1 || (cd gcp/api && docker build -f Dockerfile. esp -t osv/esp:latest .)
129+ docker inspect osv/esp:latest > /dev/null 2>&1 || docker build -f docker/ esp/Dockerfile -t osv/esp:latest docker/esp
137130 @cd go && go build -o ./api-devserver ./cmd/api-devserver && (GOOGLE_CLOUD_PROJECT=oss-vdb-test OSV_VULNERABILITIES_BUCKET=osv-test-vulnerabilities ./api-devserver $( ARGS) ; EXIT_CODE=$$ ? ; rm -f ./api-devserver; exit $$ EXIT_CODE)
138131
139- # Legacy Python API server targets
140- run-python-api-server :
141- test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
142- cd gcp/api && docker build -f Dockerfile.esp -t osv/esp:latest .
143- cd gcp/api && $(install-cmd ) && GOOGLE_CLOUD_PROJECT=oss-vdb OSV_VULNERABILITIES_BUCKET=osv-vulnerabilities $(run-cmd ) python test_server.py $(HOME ) /.config/gcloud/application_default_credentials.json $(ARGS )
144-
145- run-python-api-server-test :
146- test -f $(HOME ) /.config/gcloud/application_default_credentials.json || (echo " GCP Application Default Credentials not set, try 'gcloud auth application-default login'" ; exit 1)
147- cd gcp/api && docker build -f Dockerfile.esp -t osv/esp:latest .
148- cd gcp/api && $(install-cmd ) && GOOGLE_CLOUD_PROJECT=oss-vdb-test OSV_VULNERABILITIES_BUCKET=osv-test-vulnerabilities $(run-cmd ) python test_server.py $(HOME ) /.config/gcloud/application_default_credentials.json $(ARGS )
149-
150132# TODO: API integration tests.
151133all-tests : lib-tests worker-tests importer-tests recoverer-tests website-tests vulnfeed-tests bindings-tests go-tests # # Run all tests
152134
0 commit comments