Can't run UI test for iOS on Bitrise - ios

I'm following this tutorial using their own sample repository that I forked from GitHub: https://discuss.bitrise.io/t/how-to-do-calabash-uitesting-on-bitrise/361 I'm not doing anything special or anything different than the tutorial.
I managed to get the APK and Android UI test working using calabash. But for some reason the APP for iOS is not in the artifacts despite it says it built it and the UI tests (also with calabash) are failing.
Cucumber Features
1 scenario (1 failed)
4 steps (4 skipped)
Finished in 6m22.928s seconds
Expand All
Collapse All
Feature: Sample Feature
features/sample.feature:3
Scenario: Sample Scenario
Could not connect to the DeviceAgent service.
device: #<Simulator: iPhone 6 (11.4) FDAAB45E-52F1-4133-A02D-632AA6A9A369 x86_64>
url: http://127.0.0.1:27753/
To diagnose the problem tail the launcher log file:
$ tail -1000 -F /Users/vagrant/.calabash/iOSDeviceManager/logs/current.log
./features/support/01_launch.rb:27:in `Before'
25 }
26
27 launcher.relaunch(options)
28end
29
30# gem install syntax to get syntax highlighting
Given the app has launched
features/steps/sample_steps.rb:1
And I have done a specific thing
features/steps/sample_steps.rb:7
When I do something
features/steps/sample_steps.rb:32
Then something should happen
features/steps/sample_steps.rb:41
Here is the bitrise.yml:
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: xamarin
trigger_map:
- push_branch: "*"
workflow: primary
- pull_request_source_branch: "*"
workflow: primary
workflows:
primary:
steps:
- activate-ssh-key#3.1.1:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone#4.0.11: {}
- script#1.1.5:
title: Do anything with Script step
- certificate-and-profile-installer#1.9.3: {}
- nuget-restore#1.0.7: {}
- xamarin-archive#1.5.0:
inputs:
- xamarin_solution: "$BITRISE_PROJECT_PATH"
- xamarin_configuration: "$BITRISE_XAMARIN_CONFIGURATION"
- xamarin_platform: "$BITRISE_XAMARIN_PLATFORM"
- calabash-ios-uitest#1.3.1:
inputs:
- work_dir: "./iOS"
- deploy-to-bitrise-io#1.3.12: {}
- create-android-emulator#1.1.5:
inputs:
- name: FOO
- start-android-emulator#1.3.2: {}
- calabash-android-uitest#1.2.1:
inputs:
- work_dir: "./Droid"
app:
envs:
- opts:
is_expand: false
BITRISE_PROJECT_PATH: Multiplatform.sln
- opts:
is_expand: false
BITRISE_XAMARIN_CONFIGURATION: calabash
- opts:
is_expand: false
BITRISE_XAMARIN_PLATFORM: Any CPU

I asked the people from Bitrise and apparently calabsh-ios support Xcode 6 and 7 which are old and Bitrise doesn't provide a stack for that version.
https://github.com/calabash/calabash-ios

Related

Where is the "Hello world" going to be printed after following shadow-cljs documentation to watch the app?

I am following shadow-cljs Quick Start documentation on a minimal example of a project. Here is the link.
I have this shadow-cljs.edn file:
;; shadow-cljs configuration
{:source-paths
["src/dev"
"src/main"
"src/test"]
:dev-http {8080 "public"}
:dependencies
[]
:builds
{:frontend
{:target :browser
:modules {:main {:init-fn acme.frontend.app/init}}
}}}
In /Users/pedro/projects/acme-app/src/main/acme/frontend/app.cljs, I also have:
(ns acme.frontend.app)
(defn init []
(println "Hello World"))
I can build and watch it with the command:
$ npx shadow-cljs watch frontend
shadow-cljs - config: /Users/pedro/projects/acme-app/shadow-cljs.edn
shadow-cljs - HTTP server available at http://localhost:8080
shadow-cljs - server version: 2.20.2 running at http://localhost:9630
shadow-cljs - nREPL server started on port 61214
shadow-cljs - watching build :frontend
[:frontend] Configuring build.
[:frontend] Compiling ...
[:frontend] Build completed. (127 files, 0 compiled, 0 warnings, 6.97s)
Since the init function is a "Hellow World" function I was expecting to see it in some place. But, I can't find anywhere "showing" the Hello World to see it worked out.
Where is the "Hello World" supposed to "appear"? Is it supposed only to be available in the REPL inside the IDE as a function to be invoked by the programmer?
The "hello world" is not printed on the terminal (see above the message retrieved), is not displayed on the UI on localhost:8080 (that would probably need a tweak in HTML - see pic below), and does not appear on the browser console (that would probably need js/console.log).
These are the failed attempts to invoke the functions in the REPL after executing npx shadow-cljs node-repl:
cljs.user=> (acme.frontend.app/init)
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:2
Use of undeclared Var acme.frontend.app/init
--------------------------------------------------------------------------------
cljs.user=> (main.acme.frontend.app/init)
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:2
No such namespace: main.acme.frontend.app, could not locate main/acme/frontend/app.cljs, main/acme/frontend/app.cljc, or JavaScript source providing "main.acme.frontend.app"
--------------------------------------------------------------------------------
This is the image on localhost:8080:
You appear to have skipped the creation of the public/index.html, as mentioned in the Quick Start. The build is using :target :browser, so it is meant to be loaded in the Browser. The HTML will do that. When loaded you'll see the println in the Browser Console.
For the REPL the code always needs to be loaded before if can be used. So, you need a (require '[acme.frontend.app :as x]) before running (x/init).

How to use a circleci orb

I am new to circleci so not sure how to use an orb. Couldn't find a good example documetation. The orb in question is this https://circleci.com/developer/orbs/orb/ganezasan/auto-cancel-workflow
The idea is that circleci should be able to cancel other josb whose tests are failed. Instead of re-inventing the wheel, i found this orb but couldn't find a sample config.yml file.
How can i use this orb in my existing config.yml file?
The orb page you linked provides a usage example:
jobs:
failed-job:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 30 && exit 1
success-job-1:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 60
success-job-2:
docker:
- image: 'cimg/base:stable'
steps:
- run: sleep 60
orbs:
auto-cancel: ganezasan/auto-cancel-workflow#0.0.7
version: 2.1
workflows:
cancel-workflow:
jobs:
- success-job-1
- success-job-2
- failed-job
- auto-cancel/auto-cancel:
api_token: CIRCLE_TOKEN
interval_seconds: 10
But basically. You need to add the orb to your config.yml using this code block
orbs:
auto-cancel: ganezasan/auto-cancel-workflow#0.0.7
and then you need to add this job to your workflow
- auto-cancel/auto-cancel:
api_token: CIRCLE_TOKEN
interval_seconds: 10
and then you need to make sure you have an environment variable added to your project called CIRCLE_TOKEN with the value set to a CircleCI API token that you can generate under User Settings > Personal API Tokens.
But rather than using this orb you may want to look at running your jobs in series using requires. In the workflow below if test1 fails both test2 and deploy will be skipped. If test 1 is successful, test2 will run. If test2 fails then deploy will be skipped.
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
- test1:
requires:
- build
- test2:
requires:
- test1
- deploy:
requires:
- test2

2FA App Store - Application specific passwords and FASTLANE_SESSION can't be used more than once?

I'm setting up a pipeline with Azure, which works fine for the first time, but when I try to use it again it doesn't use the application specific password anymore.
Here's what I have done:
Reinstalled fastlane.
Created a new application specific password at App Store.
Created a new FASTLANE_SESSION running the command spaceauth -u user#email.com on terminal.
It works once in a while, usually after reinstalling Fastlane.
Apart from this, the pipeline works fine.
pool:
vmImage: 'macos-latest'
steps:
- task: InstallAppleCertificate#2
inputs:
certSecureFile: 'iOSDistributionCertificate.p12'
certPwd: 'xxxxx'
keychain: 'temp'
- task: InstallAppleProvisioningProfile#1
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: '4e932719-f9bd-4d3e-b4e6-08b35260c632.mobileprovision'
- task: ios-bundle-version#1
inputs:
sourcePath: 'BookingApp/info.plist'
versionCodeOption: 'buildid'
versionCode: '$(Build.BuildId)'
versionCodeOffset: '0'
printFile: true
- task: Xcode#5
displayName: 'Build the app using Xcode'
inputs:
actions: 'build'
sdk: 'iphoneos12.4'
configuration: 'Release'
scheme: 'BookingApp'
packageApp: true
xcodeVersion: 10 # Options: 8, 9, 10, default, specifyPath
signingOption: 'auto'
useXcpretty: false # Makes it easier to diagnose build failures
xcWorkspacePath: '**/*.xcodeproj/project.xcworkspace'
- task: AppStoreRelease#1
inputs:
serviceEndpoint: 'Booking App Connection'
appType: 'iOS'
ipaPath: '**/*.ipa'
releaseTrack: 'TestFlight'
installFastlane: false
Here's the output :
[command]fastlane pilot upload -u *** -i /Users/runner/runners/2.158.0/work/1/s/output/$(SDK)/$(Configuration)/BookingApp.ipa -q XXXXXXXX -r XXXXXX PLC
[15:59:22]: [33mGet started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile[0m
[15:59:23]: Sending anonymous analytics information
[15:59:23]: Learn more at https://docs.fastlane.tools/#metrics
[15:59:23]: No personal or sensitive data is sent.
[15:59:23]: You can disable this by adding `opt_out_usage` at the top of your Fastfile
[15:59:23]: Login to App Store Connect (***)
Session loaded from environment variable is not valid. Continuing with normal login.
Two-factor Authentication (6 digits code) is enabled for account '***'
More information about Two-factor Authentication: https://support.apple.com/en-us/HT204915
If you're running this in a non-interactive session (e.g. server or CI)
check out https://github.com/fastlane/fastlane/tree/master/spaceship#2-step-verification
(Input `sms` to escape this prompt and select a trusted phone number to send the code as a text message)
(You can also set the environment variable `SPACESHIP_2FA_SMS_DEFAULT_PHONE_NUMBER` to automate this)
(Read more at: https://github.com/fastlane/fastlane/blob/master/spaceship/docs/Authentication.md#auto-select-sms-via-spaceship-2fa-sms-default-phone-number)
Any idea on what could be the issue ? I'm using fastlane 2.28.3
Thanks in advance.

Travis allow_failures AND condition

I have a travis build file that looks like as described below (retracted). With allow_failures I would like to select rows from build matrix to meet condition
go=tip AND JOB=check
However travis evaluates it as
go=tip OR JOB=check
Is there a way to achieve the AND condition for my specific case?
go:
- 1.8
- 1.9
- tip
env:
global:
- GOARCH=amd64
matrix:
- JOB=docker
- JOB=deb
- JOB=rpm
- JOB=check
matrix:
allow_failures:
- go: tip
- env: JOB=check
Solution received here
matrix:
allow_failures:
- go: tip
env: JOB=check
https://github.com/travis-ci/travis-ci/issues/10114

Travis-CI allow_failures when multiple environment variables are set

I'm trying to set allow_failures for a complex build process, but unfortunately it isn't working.
The problem is that in my env I am setting multiple environment variables, and cannot get Travis to recognise that I want on of these rows to be allowed to fail.
The documentation on allow_failures shows how to allow a single env to fail, along with another configuration option, but doesn't cover how to allow a multiple enviroment variable setup to fail.
The troublesome sections of the .travis.yml file are below:
env:
- DJANGO_VERSION='1.8,<1.9' DB=sqlitefile SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=postgres SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=whoosh
- DJANGO_VERSION='1.8,<1.9' DB=sqlitefile SEARCH=elasticsearch
- DJANGO_VERSION='1.8,<1.9' DB=postgres SEARCH=elasticsearch
- DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=elasticsearch
matrix:
allow_failures:
- env: DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=elasticsearch
- env: DJANGO_VERSION='1.8,<1.9' DB=mysql SEARCH=whoosh
How can I do this?
Fixed!
Travis allow_failure options must be identical down to the whitespace!
So this won't work:
env:
- FOO='one' BAR='two'
- FOO='three' BAR='four'
matrix:
allow_failures:
- env: FOO='one' BAR='two'
But this will:
env:
- FOO='one' BAR='two'
- FOO='three' BAR='four'
matrix:
allow_failures:
- env: FOO='one' BAR='two'

Resources