-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Makefile to Automate Local E2E Test Setup #50
base: main
Are you sure you want to change the base?
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.
- I want you to look into if we absolutely need
pm2
, I think we should be able to achieve something similar without it. - We need a command or something to view the indexer logs during/after the run. We should be able to use
tail
command to achieve this.
e2e/README.md
Outdated
## Step 2: Install `PM2` Globally | ||
|
||
To install PM2 globally, follow these steps: | ||
|
||
1. **Open your terminal** (Command Prompt, PowerShell, or Terminal on macOS/Linux). | ||
|
||
2. **Run the following command** to install PM2 globally using npm: | ||
|
||
```bash | ||
npm install -g pm2 | ||
``` | ||
|
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 don't like that the user needs to install a global dependency. We should add it as a dev dependency and do npx pm2
e2e/makefile
Outdated
# Stop and remove Docker Compose services | ||
down: | ||
@echo "Stopping and removing Docker Compose services..." | ||
docker compose -f $(DOCKER_COMPOSE_FILE) down |
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.
docker compose -f $(DOCKER_COMPOSE_FILE) down | |
docker compose -f $(DOCKER_COMPOSE_FILE) down -v |
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.
The -v
option is meant to remove named volumes, which we do not use.
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.
It also removes anonymous volumes which are used in the image.
e2e/makefile
Outdated
clean: down | ||
@echo "Clean up completed." |
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.
redundant with down
, please remove
The problem with using '&' to start background tasks is that they must be terminated manually. In contrast, PM2 simplifies this process by assigning an identifier for easy management and control |
@theanmolsharma, Using the tail command has also been challenging due to the issues with background PIDs. As an alternative, I opted to use output log files. |
added makerfile to make local e2e test a breeze: working improved maker file structure with output logs for debug purpose
#e2e | ||
/.logs |
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.
not required because we already have *.log
on L7
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.
If you want to keep it still, it should be /e2e/.logs/
not /.logs/
Objective
Introduce a Makefile to streamline the local setup and execution of End-to-End (E2E) tests, improving developer efficiency.
Problem
Running E2E tests requires specific processes to be set up before execution, and manually configuring these processes for local testing can be time-consuming and error-prone. This repetitive task reduces developer productivity and can lead to inconsistencies in the testing environment. Automating this setup with a Makefile will make local testing more efficient and reliable.
Changes
Scope of Change
This is a non-critical update, as it only affects the local environment for running E2E tests and does not impact production code.