Operation Halland - Swift

Operation Halland


Operation Halland youtube

The week of wwdc 23 is going towards it end, but we on exercism has one final announcement.

This is the first operation on the Swift track, operations aim to deliver bigger content pieces compared to our ongoing work (like fixes, adding exercises etc).

Swift exercises on Exercism

It is an operation since this will be released over a period (likely 1-2 weeks).

Summary:

  • The swift runner runs 5.8
  • Various new features
  • Fixes

Swift 5.8

This update includes official support for 5.8 this updates the track from Swift 5.5.3 and gives all the latest features.

The new test runner also utilizes the brand new syntax parser which went along with 5.8. The parser aims to replace the current one which Swift uses and should help with giving the test runner feature proofing. For now, this parser is only used to parse the fest file so it doesn’t affect user code.

New features

With the new parser have we been able to add task id, to this to be enabled do the test files need to be updated which will occur under this operation. This hopefully results in an enchanted learning experience.

The new parser also allows us to show the test code which was run. This should help when debugging to at a glance be able to tell which test case caused it.

Fixes

This update aims to make the test runner more stable and give better messaging to the user. This is done with more stable tooling and reworking the test runner so it is smaller in size so it goes faster to debug.

I have done some testing on the site and the test runner seems to be failing far less compared to the old one (I haven’t noticed a single case).

Issues

This update includes major changes, issues will likely come up since it is both a swift update and a quite major test-runner update. Find any bugs, either open a new forum post on this forum or send a message to me on discord my name is @meatball.

Current known issues:

  • On concept exercise so is only the first test run

    The cause has been found and a fix should be published soon.

1 Like

The fix for concept exercises has been published

A patch was published yesterday. It got some improvements like indented test code, but it includes mostly fixes. Now should the output be pretty good. Found any issues then just let me know.

Changelog:

  • The test runner will run one test at a time, this is to be able to give a better error message when a test fails.
    • This may change in the future.
  • Improved message handling for unimplemented tests.
  • Improved message handling for non existing functions.
  • Fixed so the test runner will give messaging for when test doesn’t use XCTAssertEqual.
  • Fixed so the test runner don’t remove incorrect characters from test_code.
    • This was caused when a test runner had an if statement, then would the closing bracket be removed.
  • Fixed so the test runner can now handle multiline assert statements (window system exercise).
  • Fixed so the test runner will no longer output (through user output) if an error occurred when running the test.
  • The test code will now be indented.
  • Slight changes in formatting of the test runners source code.