-
Notifications
You must be signed in to change notification settings - Fork 11
Handle test assets without submodules and extra setup #180
Conversation
I thought we might have been able to use: if cfg!(test) {
unpack
println!
} But it seems like the |
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'm in favour of this! What would the rest of the work look like? :)
Oh, I was referring to actually reorganizing the tests - as you wanted to in #176. No idea yet! |
Signed-off-by: Tomasz Kurcz <[email protected]>
Signed-off-by: Tomasz Kurcz <[email protected]>
Signed-off-by: Tomasz Kurcz <[email protected]>
Rebased and added sign-offs. |
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.
Just a few things to clean up and then this is good to be merged :)
@@ -11,5 +11,5 @@ while IFS= read -r line | |||
do |
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 don't need this file anymore, right? We just use the same logic in the update script afaict. Would you mind removing this if that's the case?
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.
Yep, I meant to do that! Probably forgot. I'll add the change shortly.
scripts/update-git-platinum.sh
Outdated
|
||
# This is here in case the last script run failed and it never cleaned up. | ||
# Is there a better way to handle this? | ||
rm -rf git-platinum |
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.
Maybe a safer thing to do here is checking if the directory exists and asking the person to remove it and exiting the script.
I'm worried that we'd remove a git-platinum
by accident, e.g. we ran the script in the wrong directory 😅
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.
What if the whole script worked in some sort of .workdir
and we added that one to .gitignore
?
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.
#180 (comment) would be enough to resolve this I think :)
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 still created a sort of workdir. Feels cleaner anyway. How's that look?
scripts/update-git-platinum.sh
Outdated
set -euo pipefail | ||
|
||
## This is an update script for /data/git-platinum. It's meant to be executed | ||
## from the root of the repo. |
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 could check that we're at the root by doing:
BASE=$(basename pwd)
if [ "${BASE}" -ne "radicle-surf" ]
then
echo "this script should be run from the root of radicle-surf"
exit 1
fi
Or something along those lines :)
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.
That's excellent. I'll give it a try. I was wondering if that's possible, but my bash powers are honestly fairly weak ;)
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.
Mine aren't much better, but I sure can google! :P
@@ -11,8 +11,8 @@ Alongside this, we will wish to take two snapshots and view their differences. | |||
|
|||
## Contributing | |||
|
|||
To get started on contributing you can check out our [developing guide](./DEVELOPMENT.md), and also | |||
our [LICENSE](./LICENSE) file. | |||
To get started on contributing you can check out our [developing guide](../DEVELOPMENT.md), and also |
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.
Thanks for catching these :)
Signed-off-by: Tomasz Kurcz <[email protected]> Co-authored-by: Fintan Halpenny <[email protected]>
Signed-off-by: Tomasz Kurcz <[email protected]>
Signed-off-by: Tomasz Kurcz <[email protected]>
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.
Looks good! Just some small suggestions and then we're really ready to merge :)
Signed-off-by: Tomasz Kurcz <[email protected]> Co-authored-by: Fintan Halpenny <[email protected]>
Signed-off-by: Tomasz Kurcz <[email protected]>
Merged via f238a45 |
This is part of the work for #176, but not all of it. It's just my proposal! We can scrap it if it doesn't work for you.
How it works
git-platinum
is now kept as a tarball indata/git-platinum.tgz
. All the necessary refs are in there already. There's abuild.rs
script that extracts the archive intodata/git-platinum
, which is ignored by git (git doesn't like nested repos, so we don't want to try checking it in).Updating
git-platinum
There's a script for that -
scripts/update-git-platinum.sh
. It will fetch the newest version of git-platinum, add the necessary refs, then update and commit the archive.The big win
It should now be possible to simply
git clone
the repo and runcargo test
without extra setup necessary, keeping it simple for future contributors. Also no more submodules.Drawbacks
flate2
andtar
.