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

Add Github workflow to run tests #1372

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

matthewrfennell
Copy link
Member

@matthewrfennell matthewrfennell commented Jan 16, 2025

Here is an example run:

https://github.com/matthewrfennell/Monal/actions/runs/12838210714/job/35803392375

Next steps after this (in future PRs?)

  • Add github workflow to run tests
  • Restrict permissions of all workflows
  • Run xcbeautify on all build workflows
  • Integrate tests in MonalAppDelegate.m into test framework
  • (eventually) fix UI tests

@matthewrfennell matthewrfennell changed the title Allow running of tests from the terminal Add Github workflow to run tests Jan 17, 2025
@matthewrfennell matthewrfennell force-pushed the prepare-to-run-tests-in-build branch from 60beff7 to 40e1629 Compare January 17, 2025 23:57
XCTest prepends the product name to the name of the .xctest file. For
instance - if the target's product name is xyz, the xctest file would
be named xyz.xctest.

Since we have multiple test targets in the project, the lack of a
product name caused two xctest files to be generated with the same
name, and copied to the same build location. This caused build errors
when trying to run the test targets.

Therefore - ensure there is a product name provided for each test
target, so that we can build and run the tests.
Traditionally in Monal, tests have not been automatically run against
PRs. We are thinking of changing this and running tests against certain
PRs. As a result, we want to skip tests that always fail. It so happens
that these are all UI tests.

As a result: delete most UI tests. They can always be re-written later.
Leave one example of a test for future reference.
@matthewrfennell matthewrfennell force-pushed the prepare-to-run-tests-in-build branch from 40e1629 to 4488721 Compare January 18, 2025 14:53
@tmolitor-stud-tu
Copy link
Member

It would be great if the name, result and duration of our test could be extracted from this huge blob of xcodebuild output and printed in a separate workflow step. Maybe even with unicode checkmarks or crossmarks in front.

If you want some examples how to forward data between build steps, you could check out our stable build script and the changelog extraction in there.

No merge blocker, though :)

@matthewrfennell matthewrfennell force-pushed the prepare-to-run-tests-in-build branch 2 times, most recently from e5ac92c to cd2b095 Compare January 19, 2025 20:03
@matthewrfennell matthewrfennell force-pushed the prepare-to-run-tests-in-build branch from cd2b095 to 101976a Compare January 19, 2025 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants