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

[ test ] fix pkgs test failures #3085

Closed
wants to merge 1 commit into from

Conversation

dunhamsteve
Copy link
Contributor

The tests pkg006 and pkg015 are randomly failing. It looks like this is happening because pkg016 is installing (and later removing) packages named foo, bar, and baz. These packages are seen by the other tests if they happen to run at the same time. This PR mitigates the issue by renaming the packages in the pkg016 test.

This should fix #3084 (the issue was also noted in #3081).

@buzden
Copy link
Contributor

buzden commented Oct 3, 2023

Would it be more stable to set installation directory to a local one via environment variable to avoid this effect at all? It would be also more stable for potential future tests, because it's hard to remember this all the time and avoid to do it again.

@buzden
Copy link
Contributor

buzden commented Oct 3, 2023

By the way, we could set IDRIS2_PREFIX in testutils.sh, which now is universally used in the tests, so that we won't need to think about this each time we create new package test

UPD: well, surely, this per se is a bad solution, since now we are losing already installed libraries, like prelude or base. This is viable only for installation commands, unless we set more precise variables, like IDRIS2_PACKAGE_PATH.

@dunhamsteve
Copy link
Contributor Author

The test requires installation and then finding the installed packages in a subsequent build. I originally wanted a separate prefix, but thought it would break locating prelude and base and didn't try it.

It turns out that support is also lost if we relocate IDRIS2_PREFIX. I think I'd have to put a prefix directory inside the test (e.g. at prefix in the test directory) and symlink those directories in there. I also need to figure out the string idris-0.6.0. The test pkg017 is using a custom prefix, but doesn't reference prelude.

If we want this approach, here is what I have so far. I was only planning on calling it for the tests that install packages.

# creates a local prefix directory for package install tests
# and symlinks needed files
setup_prefix_dir() {
    prefix=$("$idris2" --prefix)
    base=$(basename "$prefix"/idris2-*)
    export IDRIS2_PREFIX="${test_dir}/prefix"
    # cleanup from previous tests
    rm -rf "$IDRIS2_PREFIX"
    mkdir -p "$IDRIS2_PREFIX/$base"
    ln -s "$prefix/$base"/* "$IDRIS2_PREFIX/$base"
}

@buzden
Copy link
Contributor

buzden commented Oct 3, 2023

I originally wanted a separate prefix, but thought it would break locating prelude and base and didn't try it.

It turns out that support is also lost if we relocate IDRIS2_PREFIX

This is all correct, and that's why I suggest to do this here #3088

@dunhamsteve
Copy link
Contributor Author

I prefer #3088 to what I described above, so I'm going to close this PR.

@dunhamsteve dunhamsteve closed this Oct 3, 2023
@dunhamsteve dunhamsteve deleted the fix-pkg006 branch October 26, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pkg006 test fails
2 participants