Skip to content

Commit

Permalink
Fix comments and broken mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
jess-lowe committed Mar 9, 2025
1 parent 0da49d5 commit 318ee2d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ run-website-staging:
cd gcp/website/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/website && $(install-cmd) && GOOGLE_CLOUD_PROJECT=oss-vdb-test $(run-cmd) python main.py


run-website-emulator:
cd gcp/website/frontend3 && npm install && npm run build
cd gcp/website/blog && hugo --buildFuture -d ../dist/static/blog
cd gcp/website && $(install-cmd) && GOOGLE_CLOUD_PROJECT=test-osv DATASTORE_EMULATOR_PORT=5002 $(run-cmd) python frontend_emulator.py
cd gcp/website && $(install-cmd) && DATASTORE_EMULATOR_PORT=5002 $(run-cmd) python frontend_emulator.py

# Run with `make run-api-server ARGS=--no-backend` to launch esp without backend.
run-api-server:
Expand Down
19 changes: 18 additions & 1 deletion gcp/website/frontend_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 1, 1),
timestamp=datetime.datetime(2023, 8, 14),
).put()
osv.Bug(
id='CVE-2',
Expand All @@ -39,6 +40,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 1, 1),
timestamp=datetime.datetime(2023, 8, 14),
).put()
osv.Bug(
id='CVE-3',
Expand All @@ -48,6 +50,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 1, 1),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -58,6 +61,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2025, 1, 14),
timestamp=datetime.datetime(2023, 8, 14),
).put()
osv.Bug(
id='UBUNTU-CVE-2023-21400',
Expand All @@ -67,6 +71,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2025, 1, 14),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -77,6 +82,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2025, 2, 10),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -87,6 +93,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2025, 2, 10),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -105,6 +112,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 29),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -123,6 +131,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 31),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -141,6 +150,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 31),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand Down Expand Up @@ -177,6 +187,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 31),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -195,6 +206,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 9, 6),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -210,6 +222,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 31),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -225,6 +238,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2025, 2, 4),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -240,6 +254,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2023, 8, 31),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand All @@ -263,6 +278,7 @@ def setUp():
source='test',
public=True,
import_last_modified=datetime.datetime(2024, 1, 9),
timestamp=datetime.datetime(2023, 8, 14),
).put()

osv.Bug(
Expand Down Expand Up @@ -345,6 +361,8 @@ def setUp():


if __name__ == '__main__':
# The datastore emulator needs to be started before main is imported
# to make the global ndb client use the emulator.
ds_emulator = tests.start_datastore_emulator()
import main
try:
Expand All @@ -353,6 +371,5 @@ def setUp():
context.set_cache_policy(False)
setUp()
main.app.run(host='127.0.0.1', port=8000, debug=False)
# main.app.run()
finally:
tests.stop_emulator()

0 comments on commit 318ee2d

Please sign in to comment.