<commit_before># `build` is a built-in helper function that maps to `hab pkg exec core/hab-plan-build`
# rather than `hab pkg build` to avoid 'studio-in-studio' situations. Verify that the
# command functions. We assume that if the build succeeds (exits 0) we've passed this
# test, and leave more detailed testing to the build output to e2e tests for hab-plan-build
hab origin key generate $env:HAB_ORIGIN

Describe "Studio build" {
    foreach($plan in @(
            "plan-in-root",
            "plan-in-habitat",
            "plan-in-target",
            "plan-in-habitat-target"
        )) {
        It "builds $plan" {
            hab pkg build test/fixtures/$plan
            $LASTEXITCODE | Should -Be 0
        }
    }

    It "does not build plan-in-root-and-habitat" {
        hab pkg build test/fixtures/plan-in-root-and-habitat
        $LASTEXITCODE | Should -Not -Be 0
    }

    It "does not build plan-in-none" {
        hab pkg build test/fixtures/plan-in-none
        $LASTEXITCODE | Should -Not -Be 0
    }

    It "builds plan in target if also in root" {
        Invoke-Build plan-in-root-and-target
        . ./results/last_build.ps1

        $pkg_name | Should -Be "target_plan"
    }

    It "saves hart in linked artifact cache" {
        Invoke-Build minimal-package
        . ./results/last_build.ps1

        "/hab/cache/artifacts/$pkg_artifact" | Should -Exist
    }

    It "builds plan in non system drive" {
        subst x: $env:USERPROFILE
        $cd = Get-Location
        $dir = Split-Path -Leaf $cd.Path
        Push-Location x:\
        New-Item -Name $dir -ItemType Junction -target $cd.Path
        Set-Location $dir
        hab pkg build test/fixtures/minimal-package
        $exitCode = $LASTEXITCODE
        Pop-Location

        $exitCode | Should -Be 0
    }
<commit_msg>only test non system drive build on windows<commit_after># `build` is a built-in helper function that maps to `hab pkg exec core/hab-plan-build`
# rather than `hab pkg build` to avoid 'studio-in-studio' situations. Verify that the
# command functions. We assume that if the build succeeds (exits 0) we've passed this
# test, and leave more detailed testing to the build output to e2e tests for hab-plan-build
hab origin key generate $env:HAB_ORIGIN

Describe "Studio build" {
    foreach($plan in @(
            "plan-in-root",
            "plan-in-habitat",
            "plan-in-target",
            "plan-in-habitat-target"
        )) {
        It "builds $plan" {
            hab pkg build test/fixtures/$plan
            $LASTEXITCODE | Should -Be 0
        }
    }

    It "does not build plan-in-root-and-habitat" {
        hab pkg build test/fixtures/plan-in-root-and-habitat
        $LASTEXITCODE | Should -Not -Be 0
    }

    It "does not build plan-in-none" {
        hab pkg build test/fixtures/plan-in-none
        $LASTEXITCODE | Should -Not -Be 0
    }

    It "builds plan in target if also in root" {
        Invoke-Build plan-in-root-and-target
        . ./results/last_build.ps1

        $pkg_name | Should -Be "target_plan"
    }

    It "saves hart in linked artifact cache" {
        Invoke-Build minimal-package
        . ./results/last_build.ps1

        "/hab/cache/artifacts/$pkg_artifact" | Should -Exist
    }

    if($IsWindows) {
        It "builds plan in non system drive" {
            subst x: $env:USERPROFILE
            $cd = Get-Location
            $dir = Split-Path -Leaf $cd.Path
            Push-Location x:\
            New-Item -Name $dir -ItemType Junction -target $cd.Path
            Set-Location $dir
            hab pkg build test/fixtures/minimal-package
            $exitCode = $LASTEXITCODE
            Pop-Location

            $exitCode | Should -Be 0
        }
    }

{'fraction_non_alphanumeric': 0.0986894891682268, 'fraction_numerical': 0.004279219042524739, 'mean_word_length': 1.9472025216706068, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5894700', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1140, 'n_words': 358}