-
Notifications
You must be signed in to change notification settings - Fork 54
Add justfile with scripts and update README #153
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just excellent 😎
409bff0
to
36aee6c
Compare
@@ -141,47 +142,47 @@ and some networking setup so that they can communicate. Note: | |||
At this stage, you can run the tests via: | |||
|
|||
```shell | |||
docker exec openverse_catalog_webserver_1 /usr/local/airflow/.local/bin/pytest | |||
just test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, if you run the tests too early, before the airflow db loads, some tests fail:
AILED dags/util/test_operator_util.py::test_get_dated_main_runner_handles_zero_shift
FAILED dags/util/test_operator_util.py::test_get_dated_main_runner_handles_day_shift
FAILED dags/util/loader/test_paths.py::test_stage_oldest_tsv_file_finds_tsv_file
FAILED dags/util/loader/test_paths.py::test_stage_oldest_tsv_file_stages_tsv_file
FAILED dags/util/loader/test_paths.py::test_stage_oldest_tsv_file_removes_staged_file_from_output_dir
FAILED dags/util/loader/test_paths.py::test_stage_oldest_tsv_file_stages_older_file
FAILED dags/util/loader/test_paths.py::test_stage_oldest_tsv_file_ignores_newer_file
FAILED dags/util/loader/test_sql.py::test_create_loading_table_creates_table
FAILED dags/util/loader/test_sql.py::test_create_loading_table_errors_if_run_twice_with_same_id
FAILED dags/util/loader/test_sql.py::test_drop_load_table_drops_table - sqlal..
They pass after the db loads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱 Does that mean we need to add a "wait for Postgres" script to the webserver entrypoint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, or maybe just write something like 'wait a minute for db to load '?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to reproduce this. Can you share what steps you took for this to happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it only happens when you first build the containers, because I tried to reproduce it now, and couldn't .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love how just
makes some commands much easier!
36aee6c
to
cfcc19d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to reduce the cognitive strain when running the containers :)
@@ -141,47 +142,47 @@ and some networking setup so that they can communicate. Note: | |||
At this stage, you can run the tests via: | |||
|
|||
```shell | |||
docker exec openverse_catalog_webserver_1 /usr/local/airflow/.local/bin/pytest | |||
just test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it only happens when you first build the containers, because I tried to reproduce it now, and couldn't .
LGTM! |
Fixes
Fixes WordPress/openverse#1718 by @sarayourfriend
Description
Adds a
justfile
and updates the README to reference those scripts. This simplifies the README and the development process by moving repetative docker/docker-compose tasks into a command runner.Tests
Install
just
and take some of the scripts for a spin and make sure they work.Checklist
Update index.md
).main
ormaster
).Developer Certificate of Origin
Developer Certificate of Origin