-
Notifications
You must be signed in to change notification settings - Fork 179
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
chore: Refactors Acceptance Tests flow logic #1618
Conversation
@@ -485,7 +485,7 @@ func unmarshalSearchIndexAnalyzersFields(mappingString string) []admin.ApiAtlasF | |||
} | |||
var fields []admin.ApiAtlasFTSAnalyzers | |||
if err := json.Unmarshal([]byte(mappingString), &fields); err != nil { | |||
log.Printf("[ERROR] cannot unmarshal search index mapping fields: %v", err) | |||
log.Printf("[ERROR] can not unmarshal search index mapping fields: %v", err) |
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.
how important is this change? should we just leave it like that? because eventually I don't think this makes it "better english" 😄
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.
this was to test that file change detection was working fine :-) i'll revert it
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.
here I changed a file, for generic I added PR label run-testacc-generic so i test different ways to trigger the tests
env: | ||
FORCE_TEST_ACC: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event.label.name == 'run-testacc' || inputs.parent-event-name == 'release' }} | ||
TF_LOG: ${{ vars.LOG_LEVEL }} | ||
SKIP_TEST_EXTERNAL_CREDENTIALS: ${{ vars.SKIP_TEST_EXTERNAL_CREDENTIALS }} | ||
ACCTEST_TIMEOUT: ${{ vars.ACCTEST_TIMEOUT }} | ||
PARALLEL_GO_TEST: "20" |
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.
are these "global" env?
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.
they are passed to all jobs
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.
are we sure this is a good idea? Here is where I would like to see all environment variables as close as possible to the job/step so I don't have to go up and down in the file to see the context.
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.
we can decide what we want to have closer and which one we want for all.
for instances in the beginning I was going to delete PARALLEL_GO_TEST and ACCTEST_TIMEOUT because they have their default values, but in this way you can change the var instead of having to change code.
about FORCE_TEST_ACC I think it's a good idea to have it here as this doesn't depend on a specific test. For example we want to run tests always if it's triggered manually (workflow_dispatch) or if it's a release
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 don't see a big problem in having common vars here. We can move them later if we realize that we want different values for different tests
search_index: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 |
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.
Could we move actions/checkout@v4
to github/actions/acceptance-test-action/action.yml
??
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.
no, that was my first try but it can't find the action file
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: ${{ inputs.filters }} |
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.
Something to keep in mind with this approach is that we call dorny/paths-filter@v2
for every job. Before we were calling dorny/paths-filter@v2
once, and then use the result of that step to run the correct jobs
.
One cons of this approach is that we will always create a run job to run every acceptance test, the job will then terminate once dorny/paths-filter@v2
is run. Right now the job is skipped instead. (Could you confirm this?)
I would suggest you to add pros/cons of this approach in the description of your PR to help the discussion
(not strong opinion here I just want to highlight this new behaviour)
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.
you're right the jobs will be created, but the tests steps will be skipped if not need to run so at the end I think it'll be equivalent. Also it's true that we call path-filters multiple times but I suppose this action internally has to do the code for each filter group so at then end it does a similar job.
one pro of current version is that it's easier to see what acceptance tests were skipped.
i can change the description to add pros and cons
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 would add pros/cons of the proposed approach in the description of the PR to help the discussion
ead0dc3
to
228d085
Compare
|
Description
Refactors Acceptance Tests flow logic so info about a resource test keeps together.
Pros
Cons
Link to any related issue(s):
Type of change:
Required Checklist:
Further comments