Skip to content

Commit

Permalink
created a temp directory at runtme to avoid collisions while running …
Browse files Browse the repository at this point in the history
…parallel tests (#2536)
  • Loading branch information
vipnydav authored Sep 25, 2024
1 parent fc7f74d commit ca3d68a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# The directory name is generated with a random component to avoid collisions as we are running implicit_dir_test and explicit_dir test parallelly.
temp_dir=$(mktemp -d)
cd "$temp_dir"
# Here $1 refers to the testBucket argument
echo "This is from directory fileInImplicitDir1 file implicitDirectory" > fileInImplicitDir1
# bucket/implicitDirectory/fileInImplicitDir1
gcloud storage cp fileInImplicitDir1 gs://$1/implicitDirectory/
echo "This is from directory implicitDirectory/implicitSubDirectory file fileInImplicitDir2" > fileInImplicitDir2
# bucket/implicitDirectory/implicitSubDirectory/fileInImplicitDir2
gcloud storage cp fileInImplicitDir2 gs://$1/implicitDirectory/implicitSubDirectory/
cd ..
rm -rf "$temp_dir"

0 comments on commit ca3d68a

Please sign in to comment.