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

GitHub Actions for Running Unit Tests #123

Merged
merged 4 commits into from
Oct 11, 2023

Conversation

hanhqvu
Copy link
Contributor

@hanhqvu hanhqvu commented Oct 10, 2023

What it Does

How I Tested

Notes

Screenshot

image image image

@hanhqvu hanhqvu requested a review from mikaelacaron as a code owner October 10, 2023 01:33
Copy link
Owner

@mikaelacaron mikaelacaron left a comment

Choose a reason for hiding this comment

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

Great work!! I have a couple of questions. I'm not terribly familiar with fastlane, so maybe some of these are basic haha


jobs:
build:
runs-on: macos-13
Copy link
Owner

Choose a reason for hiding this comment

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

Should we run on 13 or later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think that's possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems there are less runners for macOS 14 so Github Actions will wait for until 1 is available.
This might take up to 10 minutes so I think macOS 13 would be fine for now.

fastlane/Appfile Show resolved Hide resolved
fastlane/Fastfile Outdated Show resolved Hide resolved
Copy link
Owner

@mikaelacaron mikaelacaron left a comment

Choose a reason for hiding this comment

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

I can't figure out how to test this locally, I thought you could still run lanes locally, but I don't have it set up right, because I get this error, which I'm guessing is it's not connected properly to Ruby, but who knows haha, so I'm going to merge it and see what happens!

Good work!

The `fastlane' command exists in these Ruby versions:
2.7.2

@mikaelacaron mikaelacaron merged commit 3715695 into mikaelacaron:dev Oct 11, 2023
2 checks passed
@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

I can't figure out how to test this locally, I thought you could still run lanes locally, but I don't have it set up right, because I get this error, which I'm guessing is it's not connected properly to Ruby, but who knows haha, so I'm going to merge it and see what happens!

Good work!


The `fastlane' command exists in these Ruby versions:

2.7.2

You might want to try bundle exec fastlane unit_tests

@mikaelacaron
Copy link
Owner

@hanhqvu I still get that error above when I try to run that command

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

That's strange. Maybe it's because I installed Ruby as a dependency for some other homebrew package.

@mikaelacaron
Copy link
Owner

🤷‍♀️ haha I'm not sure, I'm not super familiar with fastlane, but it seems like the unit tests worked haha
I know a few people I can ask, but if you know of a good iOS tutorial, drop it here and I'll take a look! Thanks!

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

I'm not too familiar myself haha.
I mostly just followed Fastlane doc.
I'll drop a link here if I found something interesting.

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

@mikaelacaron Just a quick check, have you done the Fastlane setup yet?

@mikaelacaron
Copy link
Owner

yup! Except haha I just read through it again, I was using homebrew to install fastlane, and now I just ran the sudo gem install fastlane, lol soo.... I'm not sure how if that will affect anything 🤷‍♀️

@mikaelacaron
Copy link
Owner

Okay now I was able to run bundle exec fastlane unit_tests when it was installed with gem rather than homebrew 🤷‍♀️
haha do you think I should remove the installation with homebrew?

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

That's good to know! Probably a good idea to remove the homebrew installed fastlane I think, might lead to some conflict due to 2 versions of ruby.

@mikaelacaron
Copy link
Owner

done! thanks for the help! Do you know if I should commit the Gemfile.lock? It keeps coming up anytime I use a fastlane command

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 11, 2023

Yes, please feel free to do so! I also think we should update the Readme with info on Fastlane and its dependencies.

@mikaelacaron
Copy link
Owner

@hanhqvu you could make a new issue that does this 👍

Also update contributing, I think it's not essential, and mention that it's only needed if using fastlane for running tests, but otherwise it's fine

Also add documentation in the DocC documentation about how it works could be a good place too

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 12, 2023

@mikaelacaron I haven't done anything with DocC yet so happy to try it out! Will follow up on this after I'm done with the other issue.

@mikaelacaron
Copy link
Owner

Yeah I wouldn't worry about it, I can also make a new issue too for someone else to add it

@anupdsouza
Copy link
Contributor

Hey @hanhqvu @mikaelacaron , could you check if the workflow succeeds even if there is a test case error? I was trying CI/CD myself by replicating the changes in this PR and I found that the workflow succeeded but it did not run any of my tests in a demo project where I purposefully introduced a test case failure.. I also could not see any logs that printed the different test case classes as well. Maybe that has something to do with the yml configuration. I'm sorry if this is off-topic.

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 13, 2023

@anupdsouza I think I made a mistake with the Fastlane file.

@mikaelacaron Should I make this into an issue?

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 13, 2023

FYI, this should be the result if a test failed.
image

@anupdsouza
Copy link
Contributor

That's what I was expecting to see! @hanhqvu do you see the same behaviour on here as well in the workflow? I'm not at my desk at the moment so I can't try it out myself.

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 13, 2023

As mentioned, I think I made a mistake with Fastlane setup to run unit tests. Waiting on Mikaela on the correct workflow to fix this.

@mikaelacaron
Copy link
Owner

@hanhqvu Yes, go ahead and make a new issue and describe what's happening!
@anupdsouza Thanks for noticing this!

@hanhqvu
Copy link
Contributor Author

hanhqvu commented Oct 14, 2023

@mikaelacaron Added #173!
@anupdsouza If you are interested, feel free to assign the issue to yourself!
Otherwise I will get to it once my other PR is merged.

@hanhqvu hanhqvu deleted the 53-github-action-unit-test branch October 15, 2023 02:11
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.

GitHub Actions for Running Unit Tests
3 participants