-
Notifications
You must be signed in to change notification settings - Fork 58
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
WIP: Add changes from dahendel & co #33
base: master
Are you sure you want to change the base?
Conversation
return result, nil | ||
endpoint := "/api/v2/job_templates/" + strconv.Itoa(template.ID) | ||
template.AllowCallbacks = true | ||
template.HostConfigKey = uuid.NewV4().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.
Why we need to set these two by manually?
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.
I do not know, the original commit : davidfischer-ch@72fdcdc.
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.
CreateJobTemplateCallBack executes a PATCH HTTP Request to create the callback url and the generated host_config_key.
The values are set to get that result. OK?
organizations_test.go
Outdated
|
||
import ( | ||
"github.com/stretchr/testify/require" | ||
"github.com/stretchr/testify/suite" |
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.
Introduce a new test dependency should think twice. I'm ok to this, but I think it should be another single PR for this change.
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.
So I figured it out, the organization_test.go is special, this is an integration test powered by a test suite to make code DRY. However, its not enabled by default unless you specify the integration tag. See the latest commits.
Do you think its an idea to make a mock test instead?
I have a working AWX server, deployed with script from davidfischer-ch@d299f2a.
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.
OK?
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.
Yes, for the sake of "safe by default", if it's been disabled by default, and it also works if enabled, I'll be OK.
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.
Indeed, since its an integration test it needs an actual AWX server, up and responding to http://127.0.0.1:80. Hence the script to provision it, using docker-compose.
Thanks for your PR! I leave some comments for requesting changes. BTW, why do you disable the test cases |
Hello, I forgot to enable tests that were disabled when copying files from the contributors. I think you have the right to modify the PR, I invite you to do the modifications because you are better in judging the changes. Do you agree? |
Co-Authored-By: Jacky Wu <[email protected]>
I just enabled those tests. |
Some issues I have trying to test based on the steps in Travis Config:
I suppose Obviously same issue for |
The
For this issue, yes, you need to update the go.mod as well. |
It seems that you've NOT grant me write access to your branch, so I'd like to just leave the go mod fix code in this branch, see this commit. What's more, you should also make the
I suggest that align with the current model struct definitions. |
eec4778
to
6f91b03
Compare
@Colstuwjx this is a work in progress. I am enhancing tests and making many changes, I'll keep you informed in case I have questions or need your expertise. Thank you. |
It maybe my mistake, I'll be here if you have any questions or need help.
Sure, welcome! |
Current status : All (enabled) tests pass. I am wondering if you have some time to give a hand on this? Thanks. |
Yet another remark: 6f91b03 is changing behavior, because the update methods are now using PATCH instead of PUT to allow partial updates. Of course full updates are still possible. |
For the change behavior, I suggest move them into another separate PR, we should NOT make this PR too robust, let's just focus on introduce more AWX resources and their tests in this PR.
Okay. |
d21507f
to
8cc3a8e
Compare
Change behavior has now its own PR #34 |
Unfortunately the repository that Dustin Hendel is maintaining on GitLab is not sharing the same history. So I had to duplicate code with meld. I stripped the changes that were not relevant (such as disabling tests ...)
Please can you review it, and adapt tests accordingly.
Unfortunately I don't have (yet) much experience in go.
Best Regards,
David