diff options
author | James Lopez <james@jameslopez.es> | 2017-08-30 21:19:11 +0200 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2017-08-30 21:41:25 +0200 |
commit | b2ec631dd8b000ddb090c885206df3c16049b752 (patch) | |
tree | 2b53b26b57fa96528ae05d2e080bf81ac749a860 | |
parent | 02a04c48f30b2f8e6ba7cd036218f0ea6f027a56 (diff) | |
download | gitlab-ce-b2ec631dd8b000ddb090c885206df3c16049b752.tar.gz |
added new rake task to manage the integration test
-rw-r--r-- | lib/gitlab/import_export/README.md | 22 | ||||
-rw-r--r-- | lib/tasks/gitlab/import_export.rake | 13 |
2 files changed, 18 insertions, 17 deletions
diff --git a/lib/gitlab/import_export/README.md b/lib/gitlab/import_export/README.md index f2341bbab44..76c090caea4 100644 --- a/lib/gitlab/import_export/README.md +++ b/lib/gitlab/import_export/README.md @@ -64,19 +64,9 @@ The other numbers are reserved for changes in the actual Import/Export such as r to use a completely different configuration. 1. Update `import_export.rb` with the new version (`ImportExport::VERSION`) -1. Update the table in `import_export.md` in the docs to add the new version -1. The `import_file_spec.rb` test may fail because of the new version used, update the spec -with a new file. You can either update the file manually, or use the rake tasks: - 1. Run the following in master or stash your changes: - ```shell - bundle exec rake gitlab:import_export:import['root/test_project_export',root,'/path/to/gitlab/spec/features/projects/import_export/test_project_export.tar.gz'] - bundle exec rake gitlab:import_export:status['root/test_project_export'] # check the status of the import - ``` - 1. Switch back to your branch, bump the version (if not already) and export the integration test file again: - ```shell - bundle exec rake gitlab:import_export:export['root/test_project_export', root] - bundle exec rake gitlab:import_export:status['root/test_project_export'] # check the status of the export - ``` - 1. Copy the file (as stated in the export status check) and replace `test_project_export.tar.gz` - -Done!
\ No newline at end of file +1. Update the table in the docs to add the new version (`import_export.md`) +1. The `import_file_spec.rb` test may fail bumping the version. You can update the spec +to use the a new generated `test_project_export.tar.gz` by running the following task: + ```sh + bundle exec rake gitlab:import_export:bump_test_version + ``` diff --git a/lib/tasks/gitlab/import_export.rake b/lib/tasks/gitlab/import_export.rake index e439f9dbc93..2b31d12f5cf 100644 --- a/lib/tasks/gitlab/import_export.rake +++ b/lib/tasks/gitlab/import_export.rake @@ -67,7 +67,7 @@ namespace :gitlab do end desc 'GitLab | Check the Import/Export status of a project' - task :status, [:project_path, :gitlab_username] => :environment do |_t, args| + task :status, [:project_path] => :environment do |_t, args| project = Project.find_by_full_path(args.project_path) puts "Project exported to #{project.export_project_path}" if project.export_project_path @@ -79,5 +79,16 @@ namespace :gitlab do "Project import failed with error: #{project.import_error}" end end + + desc 'GitLab | Bumps the Import/Export version for test_project_export.tar.gz' + task bump_test_version: :environment do + Dir.mktmpdir do |tmp_dir| + system("tar -zxf spec/features/projects/import_export/test_project_export.tar.gz -C #{tmp_dir} > /dev/null") + File.write(File.join(tmp_dir, 'VERSION'), Gitlab::ImportExport.version, mode: 'w') + system("tar -zcvf spec/features/projects/import_export/test_project_export.tar.gz -C #{tmp_dir} . > /dev/null") + end + + puts "Updated to #{Gitlab::ImportExport.version}" + end end end |