Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY console/atest-ui .
RUN npm install --ignore-scripts --registry=https://registry.npmmirror.com
RUN npm run build-only

FROM docker.io/golang:1.23 AS builder
FROM docker.io/golang:1.24 AS builder

ARG VERSION
ARG GOPROXY
Expand Down Expand Up @@ -39,7 +39,7 @@ LABEL "com.github.actions.name"="API testing"
LABEL "com.github.actions.description"="API testing"
LABEL "com.github.actions.icon"="home"
LABEL "com.github.actions.color"="red"
LABEL org.opencontainers.image.description "This is an API testing tool that supports HTTP, gRPC, and GraphQL."
LABEL org.opencontainers.image.description "This is an API testing tool that supports HTTP, gRPC, and GraphQL."

LABEL "repository"="https://github.com/linuxsuren/api-testing"
LABEL "homepage"="https://github.com/linuxsuren/api-testing"
Expand All @@ -53,6 +53,6 @@ COPY --from=builder /workspace/README.md /README.md

# required for atest-store-git
RUN apk add curl openssh-client bash openssl

EXPOSE 8080
CMD ["atest", "server", "--local-storage=/var/data/api-testing/*.yaml"]
70 changes: 35 additions & 35 deletions console/atest-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/atest-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"jsonpath-plus": "^10.3.0",
"vue": "^3.3.4",
"vue-codemirror": "^5.1.0",
"vue-i18n": "^11.1.9",
"vue-i18n": "^11.1.10",
"vue-json-viewer": "^3.0.4",
"vue-router": "^4.2.2"
},
Expand Down
39 changes: 29 additions & 10 deletions console/atest-ui/src/components/TestSuiteImportDialog.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { reactive, ref } from 'vue'
import type { Suite } from '@/views/types'
import { API } from '@/views/net'
import { ElMessage } from 'element-plus'
import type { ImportSource } from '@/views/net'
import type { FormInstance, FormRules } from 'element-plus'

const { t } = useI18n()
Expand All @@ -16,14 +16,16 @@ const importSuiteFormRef = ref<FormInstance>()
const importSuiteForm = reactive({
url: '',
store: '',
kind: ''
})
kind: '',
data: ''
} as ImportSource)

const importSuiteFormRules = reactive<FormRules<Suite>>({
const importSuiteFormRules = reactive<FormRules<ImportSource>>({
url: [
{ required: true, message: 'URL is required', trigger: 'blur' },
{ required: importSuiteForm.kind !== 'native-inline', message: 'URL is required', trigger: 'blur' },
{ type: 'url', message: 'Should be a valid URL value', trigger: 'blur' }
],
data: [{ required: importSuiteForm.kind === 'native-inline', message: 'Data is required', trigger: 'blur' }],
store: [{ required: true, message: 'Location is required', trigger: 'blur' }],
kind: [{ required: true, message: 'Kind is required', trigger: 'blur' }]
})
Expand All @@ -36,7 +38,7 @@ const importSuiteFormSubmit = async (formEl: FormInstance | undefined) => {
emit('created')
formEl.resetFields()
}, (e) => {
ElMessage.error(e)
ElMessage.error(e.message)
})
}
})
Expand Down Expand Up @@ -69,12 +71,16 @@ const importSourceKinds = [{
"name": "Native",
"value": "native",
"description": "http://your-server/api/v1/suites/xxx/yaml?x-store-name=xxx"
}, {
"name": "Native-Inline",
"value": "native-inline",
"description": "Native test suite content in YAML format"
}]
const placeholderOfImportURL = ref("")
const importSourceDesc = ref("")
const kindChanged = (e) => {
importSourceKinds.forEach(k => {
if (k.value === e) {
placeholderOfImportURL.value = k.description
importSourceDesc.value = k.description
}
});
}
Expand Down Expand Up @@ -117,8 +123,15 @@ const kindChanged = (e) => {
/>
</el-select>
</el-form-item>
<el-form-item label="URL" prop="url">
<el-input v-model="importSuiteForm.url" test-id="suite-import-form-api" :placeholder="placeholderOfImportURL" />
<el-form-item label="Data" prop="data" v-if="importSuiteForm.kind === 'native-inline'">
<el-input v-model="importSuiteForm.data"
class="full-width" type="textarea"
:placeholder="importSourceDesc" />
</el-form-item>
<el-form-item label="URL" prop="url" v-else>
<el-input v-model="importSuiteForm.url" test-id="suite-import-form-api"
class="full-width"
:placeholder="importSourceDesc" />
</el-form-item>
<el-form-item>
<el-button
Expand All @@ -130,3 +143,9 @@ const kindChanged = (e) => {
</el-form>
</el-dialog>
</template>

<style scoped>
.full-width {
width: 100%;
}
</style>
3 changes: 2 additions & 1 deletion console/atest-ui/src/views/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ function CreateTestSuite(suite: TestSuite,
.then(callback).catch(emptyOrDefault(errHandle))
}

interface ImportSource {
export interface ImportSource {
store: string
url: string
kind: string
data: string
}

function UpdateTestSuite(suite: any,
Expand Down
24 changes: 13 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/linuxsuren/api-testing

go 1.23.0
go 1.24.0

toolchain go1.24.3

require (
github.com/Masterminds/sprig/v3 v3.2.3
Expand Down Expand Up @@ -33,10 +35,10 @@ require (
github.com/tidwall/gjson v1.18.0
github.com/xeipuuv/gojsonschema v1.2.0
go.uber.org/zap v1.27.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.14.0
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463
google.golang.org/grpc v1.73.0
golang.org/x/oauth2 v0.32.0
golang.org/x/sync v0.16.0
google.golang.org/genproto/googleapis/api v0.0.0-20250804133106-a7a43d27e69b
google.golang.org/grpc v1.76.0
google.golang.org/protobuf v1.36.10
gopkg.in/yaml.v3 v3.0.1
)
Expand All @@ -55,7 +57,7 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/schollz/progressbar/v3 v3.13.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/term v0.33.0 // indirect
)

require (
Expand Down Expand Up @@ -101,10 +103,10 @@ require (
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.38.0 // indirect
golang.org/x/net v0.40.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.25.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
golang.org/x/crypto v0.40.0 // indirect
golang.org/x/net v0.42.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.27.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250804133106-a7a43d27e69b // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading
Loading