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

Fix and update the docker + bats based tests #413

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mrmeszaros
Copy link

In order to make tests green the following needed to be done:

  • Fix typo in docker tag: rename to jenv:test
  • Remove openjdk 1.6 and its test
  • Fix adding_jdks.bats tests
  • Fix setting_versions.bats tests

Additionally I added some improvements:

  • Added setup_suite.bash
  • Extended adding_jdks with zulu 18 and graalvm
  • Refactored setup into: setup_suite, setup and teardown
  • Added version-name checks to setting_versions.bats

Fixes #411

test/Dockerfile Outdated
RUN yum install -y java-11-openjdk
RUN yum install -y java-1.7.0-openjdk
RUN yum install -y java-1.8.0-openjdk
RUN curl -L https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.3/graalvm-ce-java11-linux-$(arch)-22.3.3.tar.gz | tar xzf - -C /usr/lib/jvm/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If $(arch) is x86_64 should get amd64

Comment on lines 21 to 22
@test "add openjdk 1.8.0.372" {
jenv add /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.372.b07-1.el7_9.$_ARCH/jre/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably make this and other add commands not depend on build version as tests are brittle - some of these are out of date again e.g.

Suggested change
@test "add openjdk 1.8.0.372" {
jenv add /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.372.b07-1.el7_9.$_ARCH/jre/
@test "add openjdk 1.8.0" {
jenv add /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.*.el7_9.$_ARCH/jre/

Comment on lines 26 to 27
assert_line --regexp '^ *1.8.0.372$'
assert_line --regexp '^ *openjdk64-1.8.0.372$'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As other comment should make these and other assertions not depend on build version as tests are brittle and some of these are out of date again

Suggested change
assert_line --regexp '^ *1.8.0.372$'
assert_line --regexp '^ *openjdk64-1.8.0.372$'
assert_line --regexp '^ *1.8.0.[0-9]+$'
assert_line --regexp '^ *openjdk64-1.8.0.[0-9]+$'

This should ensure that tests will not break over time.
Also removed the unused _ARCH var from the test suite_setup.
Removed unnecessary subshell creations.
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.

The Dockerized tests are not runnable on macOS
2 participants