-
Notifications
You must be signed in to change notification settings - Fork 444
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
Cleanup integration tests #155
Conversation
unless ENV['JVM_COMMON_BUILDPACK'].nil? or ENV['JVM_COMMON_BUILDPACK'].empty? | ||
app.set_config("JVM_COMMON_BUILDPACK" => ENV['JVM_COMMON_BUILDPACK']) | ||
expect(app.get_config['JVM_COMMON_BUILDPACK']).to eq(ENV['JVM_COMMON_BUILDPACK']) | ||
def set_system_properties_key(key, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When setting keys and values one thing I like to do is make my input a hash so I can do something like this
set_system_properties("maven.version" => version_string)
And you can also set multiple values at the same time:
set_system_properties(
"maven.version" => version_string,
"java.runtime.version" => "11.whatever",
)
You could implement this function like this if you desired:
def set_system_properties(set_properties = {})
if File.file?("system.properties")
properties = JavaProperties.load("system.properties")
else
properties = {}
end
set_properties.each do |key, value|
properties[key.to_sym] = value
end
JavaProperties.write(properties, "system.properties")
end
c.syntax = :expect | ||
end | ||
#config.mock_with :none | ||
def set_java_version(version_string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From an API perspective, I feel like I want a single set_version
function that does both java and maven something like:
def set_version(maven: nil, java: nil)
set_system_properties_key("java.runtime.version", java) if java
set_system_properties_key("maven.version", java) if maven
end
First pass at cleaning up the integration test suite. The main goal was to solve concurrency issues, but the scope expanded a bit while refactoring:
app.directory
, fixing concurrency issues.java-properties
gem.There is still work to do in terms of what is tested and how - we're testing the same things as before. A proper refactoring across the JVM buildpack testing landscape is in the works.
Closes W-8239355