Is it possible to somehow specify the username/hostname with which CI tests are run?

I mean the WIndows user name. It would be nice if it was possible to run some tests using non-ASCII user names and I'm not sure how to do it from inside CI.

  1. Could you please clarify?

    • do you want to run tests as that new user

    or

    • you want to run tests in standard security context but test code itself should use that new user somehow
  2. Well, ideally, tests need to be run under than "new" user. Whether it's actually a new user or just some trick/hack to make a program think that it is shouldn't matter as long as the result is the same.

  3. Try to set the following:

    test_script:
    - chcp 65001
    - net user <non-ASCII-user-name> <password> /add
    - net localgroup administrators <non-ASCII-user-name> /add
    - psexec \\localhost -u <non-ASCII-user-name> -p <password> -accepteula <full-path-to-test-script>
    

    Note that test itself should be wrapped into script (<full-path-to-test-script>) and full path should be provided because new <non-ASCII-user-name> user has no environment variables which appveyor user has. Also because of this environment variables issue I envision a lot of problems with this test and you will be probably at least needed to updated path environment variable in the beginning of your test script when you see that some file cannot be found during test execution.

    To examine existing paths for appveyor user you can run -ps: $env:path -split ";". To explore build worker folder structure use RDP.

    Ilya.

  4. Thanks, it seems to work.

  5. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:16 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions