To execute tests for the OpenTelemetry.io project, follow these step-by-step instructions. This documentation will guide you in leveraging the Makefile and associated functions for efficient testing.
Step 1: Set Up Environment
Before running any tests, ensure that you have the necessary environment set up. This includes installing Node.js and npm (Node package manager) if they are not already installed.
Step 2: Clone the Repository
Start by cloning the OpenTelemetry.io repository to your local machine:
git clone https://github.com/open-telemetry/opentelemetry.io.git
cd opentelemetry.io
Step 3: Install Dependencies
After navigating into the cloned directory, install the required JavaScript dependencies using npm:
npm install
This command will read the package.json
file and install all necessary packages into the node_modules
directory.
Step 4: Explore the Makefile
The project’s Makefile
includes several functions related to testing. Review the contents of the Makefile to understand the available options, but primarily you will be using the following functions for testing:
clean
check-links-only
check-links
Step 5: Cleaning the Project
Before running tests, it can be effective to clean any previous builds. Use the following command:
make clean
This command will remove any generated files, ensuring that your testing runs on a fresh setup.
Step 6: Run Link Checks
To ensure that all hyperlinks in the project are correct and functional, use the link checking function:
make check-links-only
Executing this command will scan the project for any broken links and report them. It’s a good practice to run this check regularly.
Step 7: Check Links and Build
If you want to check links while also building the project, use the following:
make check-links
This will perform both the link checking and build the project, encapsulating these processes into a single command.
Additional Notes
- For customized or more extensive testing scenarios, modify the
Makefile
as needed to include additional scripts or commands pertinent to your testing requirements. - Always ensure that your changes do not break existing functionality by incorporating these tests as part of your development workflow.
Reference
- Makefile - Functions and commands defined within the project repository. Ensure to explore and familiarize yourself with the commands available for seamless testing.