Skip to content

Conversation

@miazamrai
Copy link
Contributor

@miazamrai miazamrai commented Oct 17, 2022

Integration tests can honor an environment variable like CUSTOM_HEADERS= '{"key1":"val1", "key2":"val2"}'. The custom headers key value pair should be valid JSON string otherwise, I runtime error will be thrown. The JSON string will be parsed into a dictionary and will passed to the create_engine function as kwargs...

export CUSTOM_HEADERS='{"x-rai-parameter-compute-version":"6df2736eccdc6a4844c2f8e8d78bcd7782046e1d"}'

@miazamrai miazamrai requested review from NRHelmi and bachdavi October 17, 2022 04:24
@NRHelmi NRHelmi requested a review from NHDaly October 17, 2022 10:01
Copy link
Member

@bachdavi bachdavi left a comment

Choose a reason for hiding this comment

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

Cool :)

Could you add an example of a valid test argument to the comments?
parse_test_args will parse the args of the julia executable not from a julia REPL, right?

@miazamrai
Copy link
Contributor Author

miazamrai commented Oct 17, 2022

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)

The github action is calling it using julia binary with --project

Cool :)

Could you add an example of a valid test argument to the comments? parse_test_args will parse the args of the julia executable not from a julia REPL, right?

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)

The github action is calling it using julia binary with --project

It also works with REPL
Like
julia> include("test/runtests.jl") -> goes to the create engine without version

Copy link
Contributor

@NRHelmi NRHelmi left a comment

Choose a reason for hiding this comment

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

Thanks @miazamrai

@bachdavi
Copy link
Member

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)
The github action is calling it using julia binary with --project

Cool :)
Could you add an example of a valid test argument to the comments? parse_test_args will parse the args of the julia executable not from a julia REPL, right?

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)

The github action is calling it using julia binary with --project

It also works with REPL Like julia> include("test/runtests.jl") -> goes to the create engine without version

Awesome 🎉
Could you add the two to the source code as well :)
I just checked ArgParse.jl and we use the Base.ARGS constant, a vector of strings containing the command line arguments. It seems this cannot be changed in a running REPL...
But I guess that is fine!

@bachdavi
Copy link
Member

Also we see this in the test logs:

┌ Warning: `@add_arg_table` is deprecated, use `@add_arg_table!` instead
└ @ ArgParse ~/work/rai-sdk-julia/rai-sdk-julia/test/runtests.jl:34

We can change it to the one with the bang.

@miazamrai
Copy link
Contributor Author

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)
The github action is calling it using julia binary with --project

Cool :)
Could you add an example of a valid test argument to the comments? parse_test_args will parse the args of the julia executable not from a julia REPL, right?

I have added the example but I am not sure whether parse_test_args will work with REPL or not? I am not that familiar with Julia yet :)

The github action is calling it using julia binary with --project

Tested it with REPL, it works!

Like

julia> include(test/runtests.jl)

or

module test
ARGS={"}
include("test.jl")
end

Also we see this in the test logs:

┌ Warning: `@add_arg_table` is deprecated, use `@add_arg_table!` instead
└ @ ArgParse ~/work/rai-sdk-julia/rai-sdk-julia/test/runtests.jl:34

We can change it to the one with the bang.

@bachdavi I have talked to @NRHelmi and we are agreed on sending the custom headers as an env variable. So no command line arguments will be used. It is to use the same approach for all the SDKs and env variable seems like the easiest and the most consistent approach to follow.

@miazamrai miazamrai merged commit b834885 into main Oct 17, 2022
@NHDaly NHDaly deleted the ia-custom-engine-version branch October 18, 2022 02:34
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.

3 participants