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

Generating fixture internally #457

Merged
merged 1 commit into from
Dec 20, 2019
Merged

Generating fixture internally #457

merged 1 commit into from
Dec 20, 2019

Conversation

fao89
Copy link
Member

@fao89 fao89 commented Dec 17, 2019

https://pulp.plan.io/issues/5873
closes #5873

Please be sure you have read our documentation on creating PRs:
https://docs.pulpproject.org/en/3.0/nightly/contributing/pull-request-walkthrough.html

@fao89 fao89 requested a review from a team December 17, 2019 18:30
@fao89 fao89 force-pushed the 5873 branch 2 times, most recently from cdf856e to 8c19cce Compare December 17, 2019 19:07
@fao89 fao89 changed the title Generating fixture internally WIP - Generating fixture internally Dec 17, 2019
@fao89 fao89 force-pushed the 5873 branch 5 times, most recently from e790852 to b5f19d7 Compare December 18, 2019 14:17
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 18, 2019
cd $TRAVIS_BUILD_DIR/../pulp-operator
.travis/pulp-operator-check-and-wait.sh
cd $TRAVIS_BUILD_DIR/../pulpcore

Copy link
Member

Choose a reason for hiding this comment

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

Are these changes specific to pulpcore?

If so, they need to be in PRE_BEFORE_SCRIPT or POST_BEFORE_SCRIPT.

If they need to be in pulpcore, they need to be in the plugin-template. There would be a corresponding PR in plugin-template reviewed at the same time as pulpcore's PR.

fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 19, 2019
@fao89 fao89 force-pushed the 5873 branch 2 times, most recently from 589b083 to 2a8d2bc Compare December 19, 2019 18:18
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 19, 2019
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 19, 2019
@fao89 fao89 force-pushed the 5873 branch 14 times, most recently from 208c1ec to 55dcc6f Compare December 19, 2019 22:13
@fao89 fao89 force-pushed the 5873 branch 3 times, most recently from a251068 to 0b3d7cc Compare December 20, 2019 02:37
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
@fao89 fao89 changed the title WIP - Generating fixture internally Generating fixture internally Dec 20, 2019
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
access_log $TRAVIS_BUILD_DIR/tmp/access.log;
}
}
NGINXCONF
Copy link
Contributor

Choose a reason for hiding this comment

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

Any chance we could put this into a separate file inside the .travis directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

done!

nginx -c `pwd`/tmp/etc/nginx.conf

cat .travis/pulp-smash-config.json | \
jq 'setpath(["custom","fixtures_origin"]; "http://localhost:8000/fixtures/")' > temp.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you setting fixtures_origin here instead of just setting it in pulp-smash-config.json? Is this to avoid conflicts with plugins?

Copy link
Member Author

Choose a reason for hiding this comment

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

Exactly, if I declare it in pulp-smash-config.json, it would force all plugins to have local fixtures

@daviddavis
Copy link
Contributor

This is looking great. Very excited to have this. 👍

fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
@fao89 fao89 force-pushed the 5873 branch 2 times, most recently from ead0459 to 77253c4 Compare December 20, 2019 14:29
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
fao89 added a commit to fao89/pulp_file that referenced this pull request Dec 20, 2019
autoindex_exact_size off;
}
error_log $TRAVIS_BUILD_DIR/tmp/error.log;
access_log $TRAVIS_BUILD_DIR/tmp/access.log;
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick -- the indentation is inconsistent in this file.

Copy link
Member

@mikedep333 mikedep333 left a comment

Choose a reason for hiding this comment

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

It looks like we should refactor this into an option for plugin-template. Only a few variables would be involved: A boolean generate local fixtures (which affects nginx in .travis.yml) in template_config.yml, blocks of code based in before_script.sh if it is true, and we'd change the pulp-smash-config.json based on the plugin name.

Note that you seemed to indicate that pulp-smash-config.json is part of plugin-template, but I do not see it there.

@@ -35,6 +35,7 @@ addons:
packages:
- httpie
- jq
- nginx
Copy link
Member

Choose a reason for hiding this comment

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

Where is the corresponding change to plugin-template?

Without it, it would be blown away by it being run.

@fao89
Copy link
Member Author

fao89 commented Dec 20, 2019

It looks like we should refactor this into an option for plugin-template. Only a few variables would be involved: A boolean generate local fixtures (which affects nginx in .travis.yml) in template_config.yml, blocks of code based in before_script.sh if it is true, and we'd change the pulp-smash-config.json based on the plugin name.

Note that you seemed to indicate that pulp-smash-config.json is part of plugin-template, but I do not see it there.

pulp-smash-config.json from pulpcore is used in all plugins:
https://github.com/pulp/plugin_template/blob/master/templates/travis/.travis/before_script.sh.j2#L23-L27

@daviddavis daviddavis merged commit 45f2ab2 into pulp:master Dec 20, 2019
daviddavis pushed a commit to pulp/pulp_file that referenced this pull request Dec 20, 2019
@pulpbot pulpbot mentioned this pull request Jan 14, 2020
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.

5 participants