Skip to content

Integration Tests: workaround to not lose debug logs#3108

Merged
NachoSoto merged 5 commits into
mainfrom
integration-tests-debug-logs
Aug 30, 2023
Merged

Integration Tests: workaround to not lose debug logs#3108
NachoSoto merged 5 commits into
mainfrom
integration-tests-debug-logs

Conversation

@NachoSoto

@NachoSoto NachoSoto commented Aug 28, 2023

Copy link
Copy Markdown
Contributor

OSLogType.debug logs are purged and not saved:

The system only captures debug-level messages in memory when you enable debug logging through a configuration change, and purges them in accordance with the configuration’s persistence setting.

I haven't been able to find a way to override this behavior. This means than when reading the logs on CI or when downloading the xcresult archive, we can't see these, making it really hard to debug failures.

See also #3048.

@NachoSoto NachoSoto added the test label Aug 28, 2023
@NachoSoto NachoSoto requested a review from a team August 28, 2023 15:31
@NachoSoto NachoSoto force-pushed the integration-tests-debug-logs branch from 08b832d to b2541f1 Compare August 28, 2023 15:36
Comment on lines 52 to 54

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file is now in ReceiptParser, which doesn't have Strings+Extensions.

@NachoSoto NachoSoto force-pushed the integration-tests-debug-logs branch from b2541f1 to 8c58944 Compare August 28, 2023 17:57
@NachoSoto NachoSoto changed the base branch from main to nacho/fixing-integration-tests August 28, 2023 17:57
@codecov

codecov Bot commented Aug 28, 2023

Copy link
Copy Markdown

Codecov Report

Merging #3108 (bc65031) into main (8efd194) will increase coverage by 0.01%.
Report is 2 commits behind head on main.
The diff coverage is n/a.

❗ Current head bc65031 differs from pull request most recent head 8c58944. Consider uploading reports for the commit 8c58944 to get more accurate results

@@            Coverage Diff             @@
##             main    #3108      +/-   ##
==========================================
+ Coverage   86.60%   86.62%   +0.01%     
==========================================
  Files         219      219              
  Lines       15683    15683              
==========================================
+ Hits        13583    13586       +3     
+ Misses       2100     2097       -3     

see 1 file with indirect coverage changes

Base automatically changed from nacho/fixing-integration-tests to main August 28, 2023 18:12
Comment thread Sources/LocalReceiptParsing/Helpers/LoggerType.swift
`OSLogType.debug` logs are purged and not saved:
> The system only captures debug-level messages in memory when you enable debug logging through a configuration change, and purges them in accordance with the configuration’s persistence setting.

I haven't been able to find a way to override this behavior. This means than when reading the logs on CI or when downloading the `xcresult` archive, we can't see these, making it really hard to debug failures.
@NachoSoto NachoSoto force-pushed the integration-tests-debug-logs branch from 1541fbe to d2fe01a Compare August 29, 2023 19:06
@NachoSoto NachoSoto merged commit b59582e into main Aug 30, 2023
@NachoSoto NachoSoto deleted the integration-tests-debug-logs branch August 30, 2023 13:10
NachoSoto added a commit that referenced this pull request Sep 5, 2023
This was wrong in #3108. `ProcessInfo+Extensions` was added to the `ReceiptParser` target, but not when building through SPM. This fixes that.
NachoSoto added a commit that referenced this pull request Sep 5, 2023
This was wrong in #3108. `ProcessInfo+Extensions` was added to the
`ReceiptParser` target, but not when building through SPM. This fixes
that.

We didn't catch this with the `spm-receipt-parser` CI job because that
does a release build.
NachoSoto pushed a commit that referenced this pull request Sep 5, 2023
**This is an automatic release.**

### Bugfixes
* `DebugViewModel`: fixed runtime crash on iOS < 16 (#3139) via
NachoSoto (@NachoSoto)
### Performance Improvements
* `PurchasesOrchestrator`: return early if receipt has no transactions
when checking for promo offers (#3123) via Mark Villacampa
(@MarkVillacampa)
* `Purchases`: don't clear intro eligibility / purchased products cache
on first launch (#3067) via NachoSoto (@NachoSoto)
### Dependency Updates
* `SPM`: update `Package.resolved` (#3130) via NachoSoto (@NachoSoto)
### Other Changes
* `ReceiptParser`: fixed SPM build (#3144) via NachoSoto (@NachoSoto)
* `carthage_installation_tests`: optimize SPM package loading (#3129)
via NachoSoto (@NachoSoto)
* `CI`: add workaround for `Carthage` timing out (#3119) via NachoSoto
(@NachoSoto)
* `Integration Tests`: workaround to not lose debug logs (#3108) via
NachoSoto (@NachoSoto)
MarkVillacampa pushed a commit that referenced this pull request Sep 6, 2023
This was wrong in #3108. `ProcessInfo+Extensions` was added to the
`ReceiptParser` target, but not when building through SPM. This fixes
that.

We didn't catch this with the `spm-receipt-parser` CI job because that
does a release build.
MarkVillacampa pushed a commit that referenced this pull request Sep 6, 2023
**This is an automatic release.**

### Bugfixes
* `DebugViewModel`: fixed runtime crash on iOS < 16 (#3139) via
NachoSoto (@NachoSoto)
### Performance Improvements
* `PurchasesOrchestrator`: return early if receipt has no transactions
when checking for promo offers (#3123) via Mark Villacampa
(@MarkVillacampa)
* `Purchases`: don't clear intro eligibility / purchased products cache
on first launch (#3067) via NachoSoto (@NachoSoto)
### Dependency Updates
* `SPM`: update `Package.resolved` (#3130) via NachoSoto (@NachoSoto)
### Other Changes
* `ReceiptParser`: fixed SPM build (#3144) via NachoSoto (@NachoSoto)
* `carthage_installation_tests`: optimize SPM package loading (#3129)
via NachoSoto (@NachoSoto)
* `CI`: add workaround for `Carthage` timing out (#3119) via NachoSoto
(@NachoSoto)
* `Integration Tests`: workaround to not lose debug logs (#3108) via
NachoSoto (@NachoSoto)
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