Bug: attribution xpcshell tests fail when run against msix packages
Status: RESOLVED
Priority: P1
Resolution: FIXED
Created: 2022-12-29 13:58:35+00:00
Resolved: 2023-01-17 16:19:50+00:00

```
[task 2022-12-28T20:22:46.841Z] 20:22:46  WARNING -  TEST-UNEXPECTED-FAIL | browser/components/attribution/test/xpcshell/test_AttributionCode.js | xpcshell return code: 0
[task 2022-12-28T20:22:46.841Z] 20:22:46     INFO -  TEST-INFO took 1509ms
[task 2022-12-28T20:22:46.841Z] 20:22:46     INFO -  >>>>>>>
[task 2022-12-28T20:22:46.841Z] 20:22:46     INFO -  (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2022-12-28T20:22:46.841Z] 20:22:46     INFO -  (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2022-12-28T20:22:46.851Z] 20:22:46     INFO -  (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2022-12-28T20:22:46.851Z] 20:22:46     INFO -  running event loop
[task 2022-12-28T20:22:46.851Z] 20:22:46     INFO -  browser/components/attribution/test/xpcshell/test_AttributionCode.js | Starting
[task 2022-12-28T20:22:46.851Z] 20:22:46     INFO -  (xpcshell/head.js) | test pending (2)
[task 2022-12-28T20:22:46.851Z] 20:22:46     INFO -  TEST-PASS | browser/components/attribution/test/xpcshell/test_AttributionCode.js |  - "test_AttributionCode" != "head"
[task 2022-12-28T20:22:46.852Z] 20:22:46     INFO -  (xpcshell/head.js) | test run_next_test 0 finished (2)
[task 2022-12-28T20:22:46.852Z] 20:22:46     INFO -  (xpcshell/head.js) | test run_next_test 1 pending (2)
[task 2022-12-28T20:22:46.852Z] 20:22:46     INFO -  (xpcshell/head.js) | test finished (2)
[task 2022-12-28T20:22:46.852Z] 20:22:46     INFO -  browser/components/attribution/test/xpcshell/test_AttributionCode.js | Starting testValidAttrCodes
[task 2022-12-28T20:22:46.852Z] 20:22:46     INFO -  (xpcshell/head.js) | test testValidAttrCodes pending (2)
[task 2022-12-28T20:22:46.853Z] 20:22:46     INFO -  (xpcshell/head.js) | test run_next_test 1 finished (2)
[task 2022-12-28T20:22:46.853Z] 20:22:46  WARNING -  TEST-UNEXPECTED-FAIL | browser/components/attribution/test/xpcshell/test_AttributionCode.js | testValidAttrCodes - [testValidAttrCodes : 19] Parsed code should match expected value, code was: source%3Dgoogle.com%26medium%3Dorganic%26campaign%3D(not%20set)%26content%3D(not%20set) - {} deepEqual {"source":"google.com","medium":"organic","campaign":"(not%20set)","content":"(not%20set)"}
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  Z:/task_167225696551533/build/tests/xpcshell/tests/browser/components/attribution/test/xpcshell/test_AttributionCode.js:testValidAttrCodes:19
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  Z:\task_167225696551533\build\tests\xpcshell\head.js:_do_main:238
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  Z:\task_167225696551533\build\tests\xpcshell\head.js:_execute_test:585
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  -e:null:1
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  exiting test
[task 2022-12-28T20:22:46.854Z] 20:22:46     INFO -  Unexpected exception NS_ERROR_ABORT:
[task 2022-12-28T20:22:46.855Z] 20:22:46     INFO -  _abort_failed_test@Z:\task_167225696551533\build\tests\xpcshell\head.js:863:20
[task 2022-12-28T20:22:46.855Z] 20:22:46     INFO -  do_report_result@Z:\task_167225696551533\build\tests\xpcshell\head.js:964:5
[task 2022-12-28T20:22:46.856Z] 20:22:46     INFO -  Assert<@Z:\task_167225696551533\build\tests\xpcshell\head.js:71:21
[task 2022-12-28T20:22:46.856Z] 20:22:46     INFO -  Assert.prototype.report@resource://testing-common/Assert.sys.mjs:240:10
[task 2022-12-28T20:22:46.856Z] 20:22:46     INFO -  deepEqual@resource://testing-common/Assert.sys.mjs:320:8
[task 2022-12-28T20:22:46.856Z] 20:22:46     INFO -  testValidAttrCodes@Z:/task_167225696551533/build/tests/xpcshell/tests/browser/components/attribution/test/xpcshell/test_AttributionCode.js:19:12
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  _do_main@Z:\task_167225696551533\build\tests\xpcshell\head.js:238:6
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  _execute_test@Z:\task_167225696551533\build\tests\xpcshell\head.js:585:5
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  @-e:1:1
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  exiting test
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  "CONSOLE_MESSAGE: (info) Attribution code cannot be written for MSIX builds, aborting."
[task 2022-12-28T20:22:46.857Z] 20:22:46     INFO -  <<<<<<<
```

The attribution code currently assumes it can write to the install directory for the purpose of testing -- which is not true for MSIX packages. We'll need to rework how the tests work to fix this.