Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Fix GithubLoginModel token storage tests on VSTS macOS builds #1568

@daviwil

Description

@daviwil

While finishing up the work on the Atom Nightly Releases PR, I've run across some hard-to-resolve test failures when running the GitHub package tests on VSTS macOS builds. To finish up that PR, I've had to temporarily disable the set of tests for GithubLoginModel which exercise the different token storage strategies.

Here's the logs of the tests that are currently failing:

 GithubLoginModel default strategy manages passwords:
    AssertionError: assert.equal((await loginModel.getToken('test-account')), TOKEN): expected Symbol(UNAUTHENTICATED) to equal 'TOKEN'
       at Context.<anonymous> (/Users/vsts/agent/2.134.2/work/1/s/node_modules/github/test/models/github-login-model.test.js:22:18)
       at <anonymous>
 GithubLoginModel SecurityBinaryStrategy manages passwords:
     Error: Command failed: security add-generic-password -s atom-github -a test-account -w TOKEN -U
 security: SecKeychainItemCreateFromContent (<default>): The specified item already exists in the keychain.
       at ChildProcess.exithandler (child_process.js:287:12)
       at emitTwo (events.js:126:13)
       at ChildProcess.emit (events.js:214:7)
       at maybeClose (internal/child_process.js:925:16)
       at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

My current theory is that there's some strange security/keychain configuration on their macOS agents which causes these tests to fail. I suspect that the 'default strategy' is the SecurityBinaryStrategy and the failure there causes the test-account password to still be stored when that strategy gets tested explicitly a second time.

What I can't explain is how security add-generic-password fails to update the password of this account when the -U (update existing) parameter is being passed. This is what leads me to believe that there's something weird about the macOS agent machine configuration. We'll probably have to discuss this with Microsoft.

For now, I'm detecting the CI_PROVIDER environment variable that I set on VSTS test runs and then skip these tests explicitly when it is set to VSTS. Once we can diagnose the root cause and get it fixed, this check will be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions