Before you import a project in a 'HackerRank Projects' question (front-end developer, back-end developer or both), you should ensure it is valid. A valid project should have the following:
- The project must be less than 5 MB in size.
- A hackerrank.yml configuration file in the root directory.
- The configuration should have all the required parameters. Follow Writing configuration file for Full Stack project to learn about writing a valid hackerrank.yml file.
- If the project has a server that needs to be exposed outside of the machine (eg: a web server), it should be running at port 8000 only. No other port is exposed outside the machine.
- The scoring command should run successfully and produce a valid output.
Follow Scoring a Full Stack question to learn about valid scoring methods for a project-based question's project.
How validation works
To ensure the imported project is valid, a validation step is run automatically when a project is imported. Here is how the validation step works:
- Ensure the project zip is less than 5 MB in size.
- Verify that hackerrank.yml is present in the root directory of the project.
- Validate hackerrank.yml for correct format and required values
- Start a server with the project zip and run the scoring command. This step can take some time.
- Once the scoring command has run successfully, the output is checked for a valid output.
- If the scoring output is valid, it is checked for a valid score. If test case weights are provided in the configuration file, they are also verified in this step.
A project must clear all steps to be considered valid.
Note: The scoring command once ran, should finish within 5 minutes. If the scoring command takes longer than 5 minutes, a timeout error will happen.