Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add command source locations to test log #7797

Merged
merged 1 commit into from
Feb 10, 2023

Conversation

roberth
Copy link
Member

@roberth roberth commented Feb 9, 2023

Motivation

Ctrl+click to the location of the test failure (heuristically in vscode)

Example:

    +(inputs.sh:39) writeSimpleFlake /tmp/nix-shell.VLOn9z/nix-test/tests/flakes/inputs/repo-32653/b-low
    +(./common.sh:13) local flakeDir=/tmp/nix-shell.VLOn9z/nix-test/tests/flakes/inputs/repo-32653/b-low
    +(./common.sh:14) cat
    +(./common.sh:34) cp ../simple.nix ../simple.builder.sh ../config.nix /tmp/nix-shell.VLOn9z/nix-test/tests/flakes/inputs/repo-32653/b-low/
    +(inputs.sh:41) echo all good
    +(inputs.sh:42) cat
    +(inputs.sh:55) cd /tmp/nix-shell.VLOn9z/nix-test/tests/flakes/inputs/repo-32653/b-low

Context

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or incompatible change: updated release notes

@Ericson2314
Copy link
Member

@roberth tells me for nested set -x-ing we in fact get ++++++(inputs.sh:55) and not a stack of filenames (which could be quite long). great!

@edolstra edolstra merged commit c184566 into NixOS:master Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants