Skip to content

Conversation

@FelixTJDietrich
Copy link
Collaborator

@FelixTJDietrich FelixTJDietrich commented Jan 26, 2026

Summary

Upgrade Swift programming exercise infrastructure from Swift 5.2 to Swift 6.2, replacing the unmaintained swift-ast library with Apple's official swift-syntax, and modernizing all build templates to use native test output.

Checklist

General

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 on a test server configured with LocalVC and Jenkins.

Motivation and Context

The Swift programming exercise templates were significantly outdated:

  • Swift tools version 5.2 (current is 6.2)
  • Using unmaintained yanagiba/swift-ast library (last updated 2020)
  • Using deprecated LinuxMain.swift and XCTestManifests.swift (auto-discovery available since Swift 5.4)
  • Relying on external SwiftTestReporter instead of native xUnit output

This PR modernizes the entire Swift infrastructure to current standards.

Description

Docker Image:

Package.swift:

  • Updated swift-tools-version from 5.2 to 6.0
  • Replaced yanagiba/swift-ast with apple/swift-syntax 602.0.0

Build Scripts (Aeolus & Jenkins):

  • Use native swift test --parallel --xunit-output tests.xml instead of SwiftTestReporter
  • Note: --parallel flag is required due to a Swift 6 bug where --xunit-output doesn't work without it

Test Templates:

  • Removed deprecated LinuxMain.swift and XCTestManifests.swift
  • Removed static var allTests from test files
  • Rewrote Utilities.swift to use SwiftSyntax's SyntaxVisitor pattern for AST analysis

Xcode Templates:

  • Updated SWIFT_VERSION to 6.0
  • Updated compatibilityVersion to Xcode 16.0
  • Updated IPHONEOS_DEPLOYMENT_TARGET to 17.0

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • LocalCI configured with Docker

Test Plain Swift Exercise

  1. Log in as Instructor
  2. Create a new Swift programming exercise (not Xcode)
  3. Verify the exercise creates successfully
  4. Log in as Student
  5. Clone the repository and submit a solution
  6. Verify the build runs and tests execute
  7. Check that test results appear correctly in the UI

Test Swift Exercise with Static Code Analysis

  1. Log in as Instructor
  2. Create a new Swift programming exercise with static code analysis enabled
  3. Log in as Student
  4. Submit code with SwiftLint violations
  5. Verify SwiftLint feedback appears in the results

Exam Mode Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 Exam with a Swift Programming Exercise
  1. Log in as Instructor
  2. Create an exam with a Swift programming exercise
  3. Log in as Student
  4. Participate in the exam
  5. Submit a solution to the Swift exercise
  6. Verify tests run correctly and results are displayed

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Performance Review

  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

No code changes detected - test coverage not required for this PR.

Last updated: 2026-01-28 15:18:00 UTC

@github-project-automation github-project-automation bot moved this to Work In Progress in Artemis Development Jan 26, 2026
@github-actions github-actions bot added config-change Pull requests that change the config in a way that they require a deployment via Ansible. template labels Jan 26, 2026
Modernize Swift programming exercise infrastructure:

- Update Swift version from 5.2 to 6.0/6.2
- Replace unmaintained yanagiba/swift-ast with apple/swift-syntax 602.0.0
- Use native `swift test --parallel --xunit-output` (removes SwiftTestReporter dependency)
- Remove deprecated LinuxMain.swift and XCTestManifests.swift (auto-discovery since Swift 5.4)
- Update Xcode templates to Swift 6.0, Xcode 16.0, iOS 17.0
- Use new Docker image with Swift 6.2 and SwiftLint 0.63.1

The Utilities.swift test helper has been rewritten to use SwiftSyntax's
SyntaxVisitor pattern for structural code analysis, providing a more
robust and actively maintained foundation for AST-based testing.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@FelixTJDietrich FelixTJDietrich force-pushed the feature/programming-exercises/swift-6-upgrade branch from 00362e0 to 3134381 Compare January 28, 2026 14:43
@github-actions
Copy link

End-to-End (E2E) Test Results Summary

TestsPassed ☑️Skipped ⚠️Failed ❌️Time ⏱
End-to-End (E2E) Test Report223 ran221 passed1 skipped1 failed1h 30m 49s 630ms
TestResultTime ⏱
End-to-End (E2E) Test Report
e2e/exam/test-exam/TestExamStudentExams.spec.ts
ts.Test Exam - student exams › Check exam participants and their submissions › Search for a student in exams❌ failure7m 7s 240ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config-change Pull requests that change the config in a way that they require a deployment via Ansible. template

Projects

Status: Work In Progress

Development

Successfully merging this pull request may close these issues.

2 participants