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

Programming exercises: Add JavaScript programming language template #8859

Merged
merged 49 commits into from
Sep 19, 2024

Conversation

magaupp
Copy link
Contributor

@magaupp magaupp commented Jun 23, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I strictly followed the server coding and design guidelines.

Changes affecting Programming Exercises

  • High priority: I tested all changes and their related features with all corresponding user types on a test server configured with the integrated lifecycle setup (LocalVC and LocalCI).
  • I tested all changes and their related features with all corresponding user types locally with Gitlab and Jenkins.
  • I tested all changes and their related features with all corresponding user types on a test server configured with Gitlab and GitLab CI.

Motivation and Context

Description

This PR adds a programming language template for JavaScript.

The template runs tests using Jest. Student code and test code is transpiled with Babel to enable the use of ES6 modules.

The dependencies are cached in the docker image.

Steps for Testing

Prerequisites:

  • NodeJS installed
  • 1 Instructor
  • 1 Course
  • 1 Student

Setup

  1. Log in as Instructor to Artemis
  2. Navigate to Course Administration
  3. Create a new Programming Exercise
  4. Select Javascript as the programming language
  5. Fill out the required fields and click on Generate
  6. The Template Result should build and fail with 10 test cases
  7. The Solution Result should build and pass with 10 test cases

Local Test

  1. Clone the Test Repository into test/
  2. Clone the Solution Repository into test/assignment/
  3. Enter the test/ directory
  4. Run npm ci
  5. Run npm test
  6. The tests should pass

Exercise Participation

  1. Log in as a Student
  2. Navigate to the exercise
  3. Start the exercise
  4. Solve the exercise incorrectly
  5. The tests should fail
  6. Solve the exercise correctly
  7. The tests should pass

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Screenshots

Summary by CodeRabbit

  • New Features

    • Introduced sorting algorithms for arrays of Date objects, including Bubble Sort and Merge Sort.
    • Added a framework for generating and sorting random date objects.
    • Established classes for managing application context and policy functionalities.
    • Enhanced support for JavaScript in various components of the application.
    • Included new configurations for GitLab CI and Jenkins for automated testing and grading processes.
    • Enhanced documentation to support JavaScript in programming exercise templates.
  • Bug Fixes

    • Updated methods to ensure proper integration of JavaScript within the application's structure.
  • Tests

    • Implemented comprehensive unit tests to validate sorting functionalities and class properties.

magaupp and others added 18 commits May 28, 2024 14:52
.gitattributes and .gitignore are ignored usually ignored by gradle, but we need them to be included for programming exercise templates.
This only applies to methods returning multiple Resources using a pattern. All use-cases expect non-directories only.
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. template labels Jun 23, 2024
…template

# Conflicts:
#	src/main/java/de/tum/cit/aet/artemis/programming/service/gitlabci/GitLabCIProgrammingLanguageFeatureService.java
#	src/main/java/de/tum/cit/aet/artemis/programming/service/jenkins/JenkinsProgrammingLanguageFeatureService.java
#	src/main/java/de/tum/cit/aet/artemis/programming/service/localci/LocalCIProgrammingLanguageFeatureService.java
Copy link
Contributor

@SimonEntholzer SimonEntholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on Ts4, no idea though why it does not deploy sometimes.

Copy link
Contributor

@pzdr7 pzdr7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reapprove code after merge

Copy link
Contributor

@iyannsch iyannsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition ☺️ Could not test all CI template (e.g., GitLab) but they all seem logical 👍

Copy link
Contributor

@JohannesWt JohannesWt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@krusche krusche added this to the 7.5.4 milestone Sep 19, 2024
@krusche krusche merged commit bac8af9 into develop Sep 19, 2024
27 of 31 checks passed
@krusche krusche deleted the feature/programming-exercises/javascript-template branch September 19, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) config-change Pull requests that change the config in a way that they require a deployment via Ansible. documentation ready to merge server Pull requests that update Java code. (Added Automatically!) template tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

9 participants