Coder Social home page Coder Social logo

CircleCI iOS Setup about dd-sdk-swift-testing HOT 5 CLOSED

datadog avatar datadog commented on July 20, 2024
CircleCI iOS Setup

from dd-sdk-swift-testing.

Comments (5)

nachoBonafonte avatar nachoBonafonte commented on July 20, 2024 1

Ok, then if you are using CircleCI then you should also set the following environment variables as you did with the others, so the framework can access to them on iOS:

"CIRCLECI": $(CIRCLECI)
"CIRCLE_WORKING_DIRECTORY"= $(CIRCLE_WORKING_DIRECTORY)
"CIRCLE_BUILD_NUM"= $(CIRCLE_BUILD_NUM)
"CIRCLE_BUILD_URL"= $(CIRCLE_BUILD_URL)
"CIRCLE_WORKFLOW_ID"= $(CIRCLE_WORKFLOW_ID)
"CIRCLE_PROJECT_REPONAME"= $(CIRCLE_PROJECT_REPONAME)
"CIRCLE_SHA1"= $(CIRCLE_SHA1)
"CIRCLE_REPOSITORY_URL"= $(CIRCLE_REPOSITORY_URL)
"CIRCLE_BRANCH"= $(CIRCLE_BRANCH)
"CIRCLE_TAG"= $(CIRCLE_TAG)

Even when the env var are accessible in the system if you don't add them to the project, iOS processes cannot access them (macOS processes can, but not iOS).

With this change you should be able to have the complete git information, and you will also get information about the CircleCI process and a URL to access the CircleCI pipeline workflow directly.

Also, be sure you select your main target in Expand variables based on (or Target for Variable Expansion if using test plans) as shown here

Please let me know if it solves your issues.

from dd-sdk-swift-testing.

escakot avatar escakot commented on July 20, 2024 1

Yes, CircleCI just finished running and it's reporting correctly!

Thank you very much for your help.

from dd-sdk-swift-testing.

nachoBonafonte avatar nachoBonafonte commented on July 20, 2024

Hi Errol,

The testing framework tries to fetch Git metadata using the local .git folder on the project. In some cases that is not possible like when running on a physical device( where the source code is not on the device), if the .git folder is not located in
SRCROOT or a parent of it, or if there is a bug in the framework code (which might be the issue here, because you say that only branch information is missing).

For those cases there is a section in the docs: here where it documents the environment variables also needed to use depending on your CI provider. That you donโ€™t mention in the environment variables you are using, so you should also add.

There is a subsection there where it says: Additional Git configuration for physical device testing: , if you set those environment variables the git information will be recovered form the environment variables of your CI provider instead of the local git folder and should fox your issues.

Let me know if it works.

Thanks

from dd-sdk-swift-testing.

escakot avatar escakot commented on July 20, 2024

Hi Ignacio,

Thanks for the quick response.

We are only using Simulator on CircleCI so the CIRCLE_BRANCH env var is available. The .git folder should be there as well. It might be a bug on the backend rather than the Swift SDK. If you need more info, let me know and I'll try to provide it. Datadog is a lifesaver and we look forward to using this new tool!

Folder structure
.git/
Project.xcworkspace/
iOS/
  iOS-Project.xcodeproj/
  Sources/
  Tests/
macOS/
  macOS-Project.xcodeproj/
  Sources/
  Tests/
Shared/  # Source code that both projects use
  Sources/
  Tests/ # Test below exists here

This is an image of what we see on DD for the same test. iOS reports much later because it takes longer to build and has more tests.
98912881-BF05-4F64-9F9B-DC534188363B

from dd-sdk-swift-testing.

nachoBonafonte avatar nachoBonafonte commented on July 20, 2024

I am glad it worked. Please don't hesitate in reporting any problem or feedback you can have with the tool.

from dd-sdk-swift-testing.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.