Skip to content
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

[Feat]: Configure and add tests for scripts #2626

Open
anshgoyalevil opened this issue Feb 3, 2024 · 14 comments
Open

[Feat]: Configure and add tests for scripts #2626

anshgoyalevil opened this issue Feb 3, 2024 · 14 comments
Labels
enhancement gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code

Comments

@anshgoyalevil
Copy link
Member

Reason/Context

  • The AsyncAPI project and the number of contributors to the AsyncAPI website are growing. Sometimes things don't go as usual and may break unexpectedly when contributors work on a critical part of the website.
  • We need a mechanism to ensure that all the scripts inside the website/scripts/* folder are intact and working as they should be.
  • Writing unit tests for these scripts is the best way to ensure things don't break in production.

Description:

  • Research different testing engines and frameworks.
  • Integrate one of them into the AsyncAPI website.
  • Write proper test cases for all the scripts inside the /scripts folder.
  • Create a CI workflow to run all tests in GitHub Actions and catch errors before shipping the code.

Required skills:

  • JavaScript, Next.JS, Unit Testing, CI/CD
@anshgoyalevil
Copy link
Member Author

Please refrain from working on this issue directly. You may DM me on Slack to know the plans we have for this feature request.

@akshatnema
Copy link
Member

Mentor for this project:
Primary Mentor - @anshgoyalevil
Secondary/Backup Mentor - @akshatnema

@akshatnema akshatnema added the gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code label Feb 11, 2024
@mrkirthi-24
Copy link

hi @akshatnema Can i work on this issue?

@ankur0904
Copy link
Contributor

@anshgoyalevil @akshatnema
Hope you are doing well. I am writing to show interest in working on this issue under the GSoC 2024.

My approach to solving this problem:
Step 1. Install the testing engine
Step 2. Configure the testing engine with the project
Step 3. Write the test (Coding part) <- Construction & feedback part
Step 4. And check if it working with the local environment or not

Testing Framework
I have decided to go with the jest testing framework/engine.

Why I have chosen jest?

  • Correctness of tests: If there is any situation where our test depends on a global state, then Jest can run these tests in parallel.
  • Extensible to future uses: Jest is compatible with a variety of JS frameworks e.g. Next, Typescript, react, node etc. so Jest helps us to make a uniform test suit for other parts of projects as well if we decide to use other frameworks in future for our project.
  • Easy debugging: When our test fails then Jest will help us in debugging because it provides extra context as to why our test failed.
  • Coverage of codes: If we want a high overview of code then jest will help us to give more coverage only by adding
    --coverage flag & we don't need to do any kind of additional setup for the coverage.
  • Open-source & community support: As Jest is a popular open-source project, it provides excellent community support.

Please correct me if I am wrong anywhere.

Best regards
Ankur

@anshgoyalevil
Copy link
Member Author

Thanks for showing interest @ankur0904 :)

I would recommend you, and everyone else eager to work on this issue, please follow the official GSoC'24 timeline.

We will be reviewing the proposals during the Contributor Proposals Open period. In the meantime, you can try exploring the project and learn more about it, or better frame your proposal with various iterations.

@ankur0904
Copy link
Contributor

@anshgoyalevil :)
Thank you for your informative response. I will follow the timeline for the proposal reviews.

@JeelRajodiya
Copy link
Contributor

@anshgoyalevil
Are there any qualification tasks (similar to json-schema) for this project?

@ashmit-coder
Copy link

Hey @anshgoyalevil and @akshatnema my kind greetings. I am Ashmit Jagtap from Indian Institute of Information Technology, Pune. A Second Year Computer Science student looking forward to contribute to this project and idea. :)

@anshgoyalevil
Copy link
Member Author

@anshgoyalevil Are there any qualification tasks (similar to json-schema) for this project?

It's always better to show your knowledge by either solving issues or reviewing other PRs. Though that is not a hard requirement but is always preferred :)

@AdityaSingh-02
Copy link

Hii @akshatnema @anshgoyalevil

Hello! I'm Aditya Singh, a Computer Science undergraduate from India with a passion for open-source contributions. Previously, I had the opportunity to participate in Google Summer of Code at Rocket.chat, which was an enriching experience. This season, I'm eager to channel my skills and knowledge into contributing to AsyncAPI. This project has captured my Interest, and I'm excited about the potential impact I can make by contributing to AsyncAPI. I'm looking forward to contributing and make some impact

@maverox
Copy link

maverox commented Mar 11, 2024

Hi! I'm Uzair KHAN, a student at BPIT India studying Comp Sci.
I am programming enthusiast and my expertise are in mern stack!
I have created several projects

  • uzzenger: fullstack rtc chat app using mern stack and websockets
  • uzzurcel: vercel clone backend, using aws S3, ecs, ecr, sockets and redis for logs,
  • crisp url: url shortener using ejs and express to implement server side rendering
  • readingTime: a chrome extension to assist in reading by creating your cursor dynamic to point to text.
  • ....and many more
    githubLink

To contact me: [email protected]

What interests you most about this project?

  • Up until now my focus was primarily in development, but testing and its role in sdlc is what i wanted to get myself into

  • This project will become a major factor and incentive to learn and put those learnings to use by completing this project

  • pursuing this would drive me to learn more and more about designing tests and ensuring quality and functionality of code

As mentors and project coordinators, how can we get the best out of you?

  • Providing me with guidance by clear and frequent communication

  • Assisting me with my questions as I can be very curious and inquisitive

Is there anything that you’ll be studying or working on whilst working alongside us?

  • Learning more about collaborating and writing industry standard code and following such practices

  • Learning testsdesign principles and patterns, and frameworks that make it possible to create test suites

  • Code review and debugging

We'd love to hear a bit about your work preferences, e.g., how you keep yourself organized, what tools you use, etc.

  • figma for designing
  • i use todo list like google keep and google calendar
  • google meet for communicating and collaborating
  • vs code for coding development and testing
  • postman for api testing
  • git for version control
  • docker for containerizing and controlled runtime environment

Once you’ve selected a project from the ideas section, please suggest a weekly schedule with clear milestones and deliverables around it.

Week 1: Research and Selection of Testing Framework

  • Milestones:
    • Research different JavaScript testing engines and frameworks.
    • Evaluate compatibility with Next.js and ease of integration.
  • Deliverables:
    • Documentation outlining the pros and cons of each testing framework.
    • Selection of the most suitable testing framework with reasoning.

Week 2: Integration of Testing Framework

  • Milestones:
    • Set up the chosen testing framework within the AsyncAPI website project.
    • Configure testing environment and dependencies.
  • Deliverables:
    • Initial configuration and setup of the testing framework.
    • Documentation detailing the integration process.

Week 3-4: Writing Test Cases

  • Milestones:
    • Identify all scripts within the /scripts folder requiring testing.
    • Write comprehensive unit tests for each script.
  • Deliverables:
    • Completed test cases covering all scripts in the /scripts folder.
    • Detailed documentation of test cases including inputs, outputs, and edge cases.

Week 5: CI/CD Workflow Setup

  • Milestones:
    • Set up a CI workflow using GitHub Actions for the AsyncAPI website repository.
    • Configure automated triggering of tests upon code pushes and pull requests.
  • Deliverables:
    • Established CI/CD workflow integrated with the chosen testing framework.
    • Documentation on how to trigger and monitor tests within the CI/CD pipeline.

Week 6: Testing, Debugging, and Documentation

  • Milestones:
    • Execute the CI/CD workflow to run all tests in GitHub Actions.
    • Analyze test results and debug any failing tests or errors encountered.
    • Finalize documentation of the testing process and CI/CD integration.
  • Deliverables:
    • Completed execution of the CI/CD workflow with successful test results.
    • Comprehensive documentation covering testing process, CI/CD setup, and troubleshooting guides.

Regards
Uzair

@sherryren1020
Copy link

@anshgoyalevil Hope you are doing well. I am writing to show interest in working on this issue under GSoC 2024.
I did some reaserch about JavaScript unit testing frameworks like Jest, Mocha & Chai, and I think Jest is the best and it has great Next.js support.
Here is how I would approach this project:

  1. Setup Phase (1 week)
  • Add Jest and dependencies to project
  • Configure Jest for Next.js project
  1. Testing Phase (2 weeks)
  • Review each script in /scripts folder
  • Write test cases to cover all functionality
  • Test both positive and edge cases
  • Add tests to scripts folder structure
  1. CI/CD Phase (1 week)
  • Configure GitHub Actions workflow
  • Add script to run all tests on PRs
  • Validate tests pass before merging
  • Monitor tests and update for any code changes

@sambhavgupta0705
Copy link
Member

Hey Everyone!!
Please refrain from jumping on this issue directly

Copy link

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code
Projects
None yet
Development

No branches or pull requests

10 participants